mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Fix address out of bounds access in test.
This commit is contained in:
@@ -2,13 +2,13 @@ module test @test;
|
|||||||
|
|
||||||
fn void pointer_non_decay()
|
fn void pointer_non_decay()
|
||||||
{
|
{
|
||||||
int[3] x;
|
int[6] x;
|
||||||
int[3]* y = &x;
|
int[3]* y = (int[3]*)&x;
|
||||||
int* z = y;
|
int* z = y;
|
||||||
int[] sub = y;
|
int[] sub = y;
|
||||||
int[3] y1 = y[1];
|
int[3] y1 = y[1];
|
||||||
int z1 = z[1];
|
int z1 = z[1];
|
||||||
int* xx = &x + 1;
|
int* xx = y + 1;
|
||||||
int[3]* yy = (int[3]*)(xx);
|
int[3]* yy = (int[3]*)(xx);
|
||||||
int* zz = yy - 1;
|
int* zz = yy - 1;
|
||||||
assert(y == z);
|
assert(y == z);
|
||||||
|
|||||||
Reference in New Issue
Block a user