harec

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 6eef84a8115e651e77d25dbe750ad7254804f351
parent 41e0e8eff4a2dd513d091757966f77c8ee7c7215
Author: Armin Weigl <tb46305@gmail.com>
Date:   Sat, 27 Mar 2021 18:35:12 +0000

gen_expr_slice: dealias source

Fixes: hare#332
Fixes: hare#333

Diffstat:
Msrc/gen.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/gen.c b/src/gen.c @@ -2299,9 +2299,11 @@ gen_expr_slice(struct gen_context *ctx, gen_temp(ctx, &object, object.type, "object.%d"); object.type = temp.type; pushi(ctx->current, &object, Q_COPY, &temp, NULL); + otype = type_dealias(otype); while (otype->storage == STORAGE_POINTER) { pushi(ctx->current, &object, Q_LOADL, &object, NULL); otype = type_dereference(otype->pointer.referent); + otype = type_dealias(otype); } gen_temp(ctx, &start, &qbe_long, "start.%d");