mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2024-12-22 23:29:27 +00:00
Correctly increment/decrement pointers to large (>=64KiB) types.
Previously, the logic for this was incorrect and would lead to a null pointer dereference in the compiler. In most cases the generated code would not actually change the pointer. The following program demonstrates the issue: #include <stdio.h> #pragma memorymodel 1 typedef char bigarray[0x20000]; bigarray big[5]; int main(void) { bigarray *p = big; p++; printf("%p %p\n", (void*)big, (void*)p); }
This commit is contained in:
parent
13a14d9389
commit
91094e9292
@ -2535,7 +2535,7 @@ var
|
||||
Gen0(pc_adl)
|
||||
else
|
||||
Gen0(pc_sbl);
|
||||
with tree^.left^.id^ do
|
||||
with tree^.id^ do
|
||||
case storage of
|
||||
stackFrame, parameter:
|
||||
Gen2t(pc_cop, lln, 0, cgULong);
|
||||
|
Loading…
Reference in New Issue
Block a user