mirror of
https://gitlab.com/camelot/kickc.git
synced 2024-12-26 18:29:54 +00:00
Fixed problem with erronously coalescing structs of same size/type affected by address-of. Closes #632
This commit is contained in:
parent
f40050c558
commit
c2bfa98d8f
22
src/test/kc/struct-ptr-35.c
Normal file
22
src/test/kc/struct-ptr-35.c
Normal file
@ -0,0 +1,22 @@
|
||||
struct Tile {
|
||||
dword *Tiles;
|
||||
word Offset;
|
||||
byte Count;
|
||||
char Name[20];
|
||||
};
|
||||
|
||||
dword PlayerSprites[12];
|
||||
dword Enemy2Sprites[12];
|
||||
|
||||
struct Tile S1 = {PlayerSprites, 20, 64, "Sven" };
|
||||
struct Tile S2 = {Enemy2Sprites, 50, 128, "Jesper" };
|
||||
struct Tile *TileDB[2] = {&S1, &S2};
|
||||
|
||||
void main() {
|
||||
char * const SCREEN = 0x0400;
|
||||
|
||||
for(int i:0..1) {
|
||||
struct Tile *tile = TileDB[i];
|
||||
SCREEN[i] = tile->Count;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user