commit ca270dd081d4878f0863339779c6383a3f14f16d
parent 51c60d8d1a797d936b5d87f2cf4485da989c082f
Author: Drew DeVault <sir@cmpwn.com>
Date: Fri, 26 Feb 2021 12:08:03 -0500
gen: allow slice assignment from smaller slice
Diffstat:
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/gen.c b/src/gen.c
@@ -780,9 +780,9 @@ gen_expr_assign_slice(struct gen_context *ctx,
bequal.name = strdup(genl(&equall, &ctx->id, "equal.%d"));
bdiff.kind = QV_LABEL;
bdiff.name = strdup(genl(&diffl, &ctx->id, "diff.%d"));
- gen_temp(ctx, &temp, &qbe_long, "assign.equal.%d");
- pushi(ctx->current, &temp, Q_SUB, &olen, &vlen, NULL);
- pushi(ctx->current, NULL, Q_JNZ, &temp, &bdiff, &bequal, NULL);
+ gen_temp(ctx, &temp, &qbe_long, "assign.bounds.%d");
+ pushi(ctx->current, &temp, Q_CUGEL, &olen, &vlen, NULL);
+ pushi(ctx->current, NULL, Q_JNZ, &temp, &bequal, &bdiff, NULL);
push(&ctx->current->body, &diffl);
struct qbe_value rtabort = {0};