From 3c551628268e88c6d6dcbe729e1bc756a689dbda Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 4 Jan 2016 22:19:57 -0700 Subject: [PATCH] fix += not allowed for pointers --- src/analyze.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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: