From 054719aab24054810b91e25eb653495be90948e1 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 9 Jul 2022 15:01:25 -0500 Subject: [PATCH] Fix bug in code generation for the product of two constants. This was a problem introduced in commit 393b7304a05. It could cause a compiler error for unoptimized array indexing code, e.g.: int a[100]; int main(void) { return a[5]; } --- Gen.pas | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gen.pas b/Gen.pas index 8d2477a..cfca02a 100644 --- a/Gen.pas +++ b/Gen.pas @@ -6456,7 +6456,7 @@ procedure GenTree {op: icptr}; nd := op^.left; end; {else} if nd^.opcode = pc_ldc then - GenNative(m_lda_imm, immediate, long(ord4(val) * nd^.q).lsw, nil, 0) + GenNative(m_lda_imm, immediate, ord(ord4(val) * ord4(nd^.q)), nil, 0) else begin GenTree(nd); case val of