[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: [Bug] Incorrect bytecode generated under large amount of constants
- From: Roberto Ierusalimschy <roberto@...>
- Date: Fri, 1 Apr 2022 13:53:55 -0300
> The problem is the interleaving of the code generation of both
> expressions. Usually, if e1 is a constant that fits in K, it generates
> no code and all goes well. If e1 is not a constant, its code is
> generated before e2 and all goes well. However, if e1 is a constant
> that doesn't fit in K, its LOADI is generated after a part of e2 has
> been generated (up to the TEST). When we finish e2, it sees that
> LOADI as part of itself, which confuses the generator.
>
> Not sure yet what is a simple way to fix that...
Probably codebitwise should do as codecommutative: if the first
operand is a constant, swap both expressions, even if it cannot
use a K operation later.
-- Roberto