mirror of
https://github.com/cc65/cc65.git
synced 2025-01-16 13:31:16 +00:00
Applied fix contributed by Greg King.
The code void foo(void) { int i; long l = 1L * i; } triggered an Internal compiler error: Code generation messed up: StackPtr is -4, should be -2 Greg King: "We are lucky that the bug is simple -- a missing "else". The result is that the compiler thinks that it does the opposite of what it actually does: It thinks that it pushes the non-constant expression onto the stack. It doesn't; so, cc65's stack pointer is wrong."
This commit is contained in:
parent
38719211bd
commit
f488f7576c
@ -1952,6 +1952,7 @@ static void hie_internal (const GenDesc* Ops, /* List of generators */
|
||||
type = CF_CONST;
|
||||
if ((Gen->Flags & GEN_NOPUSH) == 0) {
|
||||
g_push (ltype, 0);
|
||||
} else {
|
||||
ltype |= CF_REG; /* Value is in register */
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user