mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-11 18:33:14 +01:00
Fixed segfault on invalid naked functions.
Emitting a frontend error during codegen is somewhat problematic in any case, but stopping if an error ocurred should work just fine here.
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
|
||||
void Statement::toNakedIR(IRState *p)
|
||||
{
|
||||
error("not allowed in naked function");
|
||||
error("statement not allowed in naked function");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////////////
|
||||
@@ -179,6 +179,11 @@ void DtoDefineNakedFunction(FuncDeclaration* fd)
|
||||
// emit body
|
||||
fd->fbody->toNakedIR(gIR);
|
||||
|
||||
// We could have generated new errors in toNakedIR(), but we are in codegen
|
||||
// already so we have to abort here.
|
||||
if (global.errors)
|
||||
fatal();
|
||||
|
||||
// emit size after body
|
||||
// llvm does this on linux, but not on osx or Win
|
||||
if (global.params.os != OSMacOSX && global.params.os != OSWindows)
|
||||
|
||||
Reference in New Issue
Block a user