diff --git a/vyper/optimizer.py b/vyper/optimizer.py
index <HASH>..<HASH> 100644
--- a/vyper/optimizer.py
+++ b/vyper/optimizer.py
@@ -11,7 +11,7 @@ def get_int_at(args, pos, signed=False):
         o = LOADED_LIMIT_MAP[args[pos].args[0].value]
     else:
         return None
-    if signed:
+    if signed or o < 0:
         return ((o + 2**255) % 2**256) - 2**255
     else:
         return o % 2**256
Fix optimization of negative integer addition

Previously when optimizing an addition involving a negative integer, the
optimizer would treat negative values as their positive two's complement
representation, which would cause overflow (e.g. -1 + 1 would equal 2**<I>
rather than 0).