mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Make UNION-related errors non-fatal
This commit is contained in:
@@ -534,10 +534,14 @@ static void createPatch(enum PatchType type, struct Expression const *expr, uint
|
|||||||
|
|
||||||
void sect_StartUnion(void)
|
void sect_StartUnion(void)
|
||||||
{
|
{
|
||||||
if (!currentSection)
|
if (!currentSection) {
|
||||||
fatalerror("UNIONs must be inside a SECTION\n");
|
error("UNIONs must be inside a SECTION\n");
|
||||||
if (sect_HasData(currentSection->type))
|
return;
|
||||||
fatalerror("Cannot use UNION inside of ROM0 or ROMX sections\n");
|
}
|
||||||
|
if (sect_HasData(currentSection->type)) {
|
||||||
|
error("Cannot use UNION inside of ROM0 or ROMX sections\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
struct UnionStackEntry *entry = malloc(sizeof(*entry));
|
struct UnionStackEntry *entry = malloc(sizeof(*entry));
|
||||||
|
|
||||||
if (!entry)
|
if (!entry)
|
||||||
@@ -559,15 +563,19 @@ static void endUnionMember(void)
|
|||||||
|
|
||||||
void sect_NextUnionMember(void)
|
void sect_NextUnionMember(void)
|
||||||
{
|
{
|
||||||
if (!unionStack)
|
if (!unionStack) {
|
||||||
fatalerror("Found NEXTU outside of a UNION construct\n");
|
error("Found NEXTU outside of a UNION construct\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
endUnionMember();
|
endUnionMember();
|
||||||
}
|
}
|
||||||
|
|
||||||
void sect_EndUnion(void)
|
void sect_EndUnion(void)
|
||||||
{
|
{
|
||||||
if (!unionStack)
|
if (!unionStack) {
|
||||||
fatalerror("Found ENDU outside of a UNION construct\n");
|
error("Found ENDU outside of a UNION construct\n");
|
||||||
|
return;
|
||||||
|
}
|
||||||
endUnionMember();
|
endUnionMember();
|
||||||
curOffset += unionStack->size;
|
curOffset += unionStack->size;
|
||||||
struct UnionStackEntry *next = unionStack->next;
|
struct UnionStackEntry *next = unionStack->next;
|
||||||
|
|||||||
Reference in New Issue
Block a user