mirror of
https://github.com/Eaglercraft-TeaVM-Fork/eagler-teavm.git
synced 2024-12-23 00:24:11 -08:00
C: generate unreachable hint after throw statement to avoid compiler warnings
This commit is contained in:
parent
ca3b565210
commit
a9ba21889a
|
@ -1217,6 +1217,10 @@ public class CodeGenerationVisitor implements ExprVisitor, StatementVisitor {
|
||||||
}
|
}
|
||||||
writer.println(";");
|
writer.println(";");
|
||||||
|
|
||||||
|
if (context.isLongjmp()) {
|
||||||
|
writer.println("TEAVM_UNREACHABLE");
|
||||||
|
}
|
||||||
|
|
||||||
popLocation(statement.getLocation());
|
popLocation(statement.getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -418,6 +418,17 @@ inline static void* teavm_nullCheck(void* o) {
|
||||||
}
|
}
|
||||||
return o;
|
return o;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUC__
|
||||||
|
#define TEAVM_UNREACHABLE __builtin_unreachable();
|
||||||
|
#endif
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
#define TEAVM_UNREACHABLE __assume(0);
|
||||||
|
#endif
|
||||||
|
#ifndef TEAVM_UNREACHABLE
|
||||||
|
#define TEAVM_UNREACHABLE return;
|
||||||
|
#endif
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define TEAVM_JUMP_SUPPORTED 0
|
#define TEAVM_JUMP_SUPPORTED 0
|
||||||
#define TEAVM_JUMP_TO_FRAME(frame, id)
|
#define TEAVM_JUMP_TO_FRAME(frame, id)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user