aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-01-04 22:19:57 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-01-04 22:19:57 -0700
commit3c551628268e88c6d6dcbe729e1bc756a689dbda (patch)
tree6ea69bdd00ffe2e6eb8ec945e250d26a80329094 /src
parentb268e3de04f30e4468c699b77898e5a5c48fe2a2 (diff)
downloadzig-3c551628268e88c6d6dcbe729e1bc756a689dbda.tar.gz
zig-3c551628268e88c6d6dcbe729e1bc756a689dbda.zip
fix += not allowed for pointers
Diffstat (limited to 'src')
-rw-r--r--src/analyze.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index 65e3022bca..c62fb9cec6 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -1166,9 +1166,12 @@ static bool is_op_allowed(TypeTableEntry *type, BinOpType op) {
case BinOpTypeAssignTimes:
case BinOpTypeAssignDiv:
case BinOpTypeAssignMod:
+ return type->id == TypeTableEntryIdInt || type->id == TypeTableEntryIdFloat;
case BinOpTypeAssignPlus:
case BinOpTypeAssignMinus:
- return type->id == TypeTableEntryIdInt || type->id == TypeTableEntryIdFloat;
+ return type->id == TypeTableEntryIdInt ||
+ type->id == TypeTableEntryIdFloat ||
+ type->id == TypeTableEntryIdPointer;
case BinOpTypeAssignBitShiftLeft:
case BinOpTypeAssignBitShiftRight:
case BinOpTypeAssignBitAnd: