Fix for empty function body

This commit is contained in:
rogerl%netscape.com 2000-09-06 02:16:51 +00:00
parent 8c105459ae
commit 7383f26d6a
2 changed files with 4 additions and 2 deletions

View File

@ -1670,7 +1670,8 @@ ICodeModule *ICodeGenerator::genFunction(FunctionStmtNode *f, bool isConstructor
const StringAtom &initName = mWorld->identifiers["__init__"]; // XXXXXXX
icg.call(icg.getStatic(mClass, initName), thisValue, &args); // ok, so it's mis-named
}
icg.genStmt(f->function.body);
if (f->function.body)
icg.genStmt(f->function.body);
if (isConstructor) {
TypedRegister thisValue = TypedRegister(0, mClass);
icg.returnStmt(thisValue);

View File

@ -1670,7 +1670,8 @@ ICodeModule *ICodeGenerator::genFunction(FunctionStmtNode *f, bool isConstructor
const StringAtom &initName = mWorld->identifiers["__init__"]; // XXXXXXX
icg.call(icg.getStatic(mClass, initName), thisValue, &args); // ok, so it's mis-named
}
icg.genStmt(f->function.body);
if (f->function.body)
icg.genStmt(f->function.body);
if (isConstructor) {
TypedRegister thisValue = TypedRegister(0, mClass);
icg.returnStmt(thisValue);