commit 3c551628268e88c6d6dcbe729e1bc756a689dbda (tree) parent b268e3de04f30e4468c699b77898e5a5c48fe2a2 Author: Andrew Kelley <superjoe30@gmail.com> Date: Mon, 4 Jan 2016 22:19:57 -0700 fix += not allowed for pointers Diffstat:
| M | src/analyze.cpp | | | 5 | ++++- |
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git 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: