mirror of
https://github.com/byteworksinc/ORCA-C.git
synced 2025-01-10 12:30:03 +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)
|
Gen0(pc_adl)
|
||||||
else
|
else
|
||||||
Gen0(pc_sbl);
|
Gen0(pc_sbl);
|
||||||
with tree^.left^.id^ do
|
with tree^.id^ do
|
||||||
case storage of
|
case storage of
|
||||||
stackFrame, parameter:
|
stackFrame, parameter:
|
||||||
Gen2t(pc_cop, lln, 0, cgULong);
|
Gen2t(pc_cop, lln, 0, cgULong);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user