aboutsummaryrefslogtreecommitdiff
path: root/src/analyze.cpp
diff options
context:
space:
mode:
authorAndrew Kelley <superjoe30@gmail.com>2016-05-16 22:51:08 -0700
committerAndrew Kelley <superjoe30@gmail.com>2016-05-16 22:51:08 -0700
commit2c710382a888e8f45b958bdf3e77213cc18c2733 (patch)
treed6933afbfeb9d50434fb1bc5c0743c4e1a083e34 /src/analyze.cpp
parent3df9389215b365a83b1a509e55086595105c1f58 (diff)
downloadzig-2c710382a888e8f45b958bdf3e77213cc18c2733.tar.gz
zig-2c710382a888e8f45b958bdf3e77213cc18c2733.zip
fix crash when error evaluating target of for expr
closes #153
Diffstat (limited to 'src/analyze.cpp')
-rw-r--r--src/analyze.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/analyze.cpp b/src/analyze.cpp
index f1834dcdd3..d28b4152b5 100644
--- a/src/analyze.cpp
+++ b/src/analyze.cpp
@@ -3953,7 +3953,7 @@ static TypeTableEntry *analyze_for_expr(CodeGen *g, ImportTableEntry *import, Bl
}
TypeTableEntry *var_type;
- if (node->data.for_expr.elem_is_ptr) {
+ if (child_type->id != TypeTableEntryIdInvalid && node->data.for_expr.elem_is_ptr) {
var_type = get_pointer_to_type(g, child_type, false);
} else {
var_type = child_type;