mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-02 19:29:21 +00:00
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:
parent
00e7fe7125
commit
054719aab2
2
Gen.pas
2
Gen.pas
@ -6456,7 +6456,7 @@ procedure GenTree {op: icptr};
|
|||||||
nd := op^.left;
|
nd := op^.left;
|
||||||
end; {else}
|
end; {else}
|
||||||
if nd^.opcode = pc_ldc then
|
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
|
else begin
|
||||||
GenTree(nd);
|
GenTree(nd);
|
||||||
case val of
|
case val of
|
||||||
|
Loading…
Reference in New Issue
Block a user