From 2e1b35a94de0c4f2462fe2aad711013304647c86 Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Mon, 17 Aug 2020 11:22:21 +0200 Subject: [PATCH] Fix Offset referenced by an iteger --- src/gencode.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/gencode.js b/src/gencode.js index 1b201c8..a70237c 100644 --- a/src/gencode.js +++ b/src/gencode.js @@ -723,7 +723,15 @@ function genVarAssignment(ctx, ast, lRef, sels, rRef) { if (instantiated) { if (offset.used) { - ctx.codeBuilder.copyN(left.label, ["R", offset.label], ["R", right.label], right.sizes[0]); + let ot; + if (offset.type == "BIGINT") { + ot = "R"; + } else if (offset.type == "INT") { + ot= "RI"; + } else { + assert(false); + } + ctx.codeBuilder.copyN(left.label, [ot, offset.label], ["R", right.label], right.sizes[0]); } else { ctx.codeBuilder.copyN(left.label, ["V", offset.value[0]], ["R", right.label], right.sizes[0]); }