-O gen-C++ tweaks to be compatible with ZAM changes

This commit is contained in:
Vern Paxson 2023-06-16 16:13:23 -07:00 committed by Arne Welzel
parent d89b39a0bb
commit 65a7e3de5f
3 changed files with 3 additions and 3 deletions

View file

@ -105,7 +105,7 @@ ValPtr when_invoke__CPP(Func* f, std::vector<ValPtr> args, Frame* frame, void* c
auto res = f->Invoke(&args, frame); auto res = f->Invoke(&args, frame);
if ( ! res ) if ( ! res )
throw DelayedCallException(); throw CPPDelayedCallException();
return res; return res;
} }

View file

@ -80,7 +80,7 @@ inline ValPtr invoke__CPP(Func* f, std::vector<ValPtr> args, Frame* frame)
extern ValPtr when_invoke__CPP(Func* f, std::vector<ValPtr> args, Frame* frame, void* caller_addr); extern ValPtr when_invoke__CPP(Func* f, std::vector<ValPtr> args, Frame* frame, void* caller_addr);
// Thrown when a call inside a "when" delays. // Thrown when a call inside a "when" delays.
class DelayedCallException : public InterpreterException class CPPDelayedCallException : public InterpreterException
{ {
}; };

View file

@ -446,7 +446,7 @@ void CPPCompile::GenWhenStmt(const WhenStmt* w)
{ {
Emit("ValPtr retval = {NewRef{}, curr_t->Lookup(curr_assoc)};"); Emit("ValPtr retval = {NewRef{}, curr_t->Lookup(curr_assoc)};");
Emit("if ( ! retval )"); Emit("if ( ! retval )");
Emit("\tthrow DelayedCallException();"); Emit("\tthrow CPPDelayedCallException();");
Emit("return %s;", GenericValPtrToGT("retval", ret_type, GEN_NATIVE)); Emit("return %s;", GenericValPtrToGT("retval", ret_type, GEN_NATIVE));
} }