Fix bug in code generation for the product of two constants.

This was a problem introduced in commit 393b7304a0. It could cause a compiler error for unoptimized array indexing code, e.g.:

int a[100];
int main(void) {
        return a[5];
}
This commit is contained in:
Stephen Heumann 2022-07-09 15:01:25 -05:00
parent 00e7fe7125
commit 054719aab2
1 changed files with 1 additions and 1 deletions

View File

@ -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