diff options
author | Michael Forney <mforney@mforney.org> | 2021-09-29 15:00:38 -0700 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2021-09-29 15:04:44 -0700 |
commit | 8a08b602e30054c283adb8fc1a4077aaf99efbca (patch) | |
tree | 87cbc9de2e91aa89b6894e46455f992fd491942d | |
parent | cb697da1d5c36ac4e75e554cbc279674dd7075f4 (diff) |
qbe: Add missing check that binary operator is + for address constant
-rw-r--r-- | qbe.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1311,7 +1311,7 @@ dataitem(struct expr *expr, uint64_t size) emitvalue(decl->value); break; case EXPRBINARY: - if (expr->binary.l->kind != EXPRUNARY || expr->binary.r->kind != EXPRCONST) + if (expr->op != TADD || expr->binary.l->kind != EXPRUNARY || expr->binary.r->kind != EXPRCONST) error(&tok.loc, "initializer is not a constant expression"); dataitem(expr->binary.l, 0); fputs(" + ", stdout); |