Skip to content

Commit

Permalink
vm: handle instance return values in default external implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
lmichaelis committed Nov 8, 2022
1 parent 7d87485 commit c8c2294
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions source/vm.cc
Original file line number Diff line number Diff line change
Expand Up @@ -559,10 +559,8 @@ namespace phoenix {
v.push_int(0);
else if (sym.rtype() == datatype::string)
v.push_string("");

// TODO: We can't really push an instance since we'd need to take the type into account. Sadly,
// compiled scripts don't store the type of instance being returned so pushing one would
// most likely just result in the VM panicking anyways.
else if (sym.rtype() == datatype::instance)
v.push_instance(nullptr);
}

callback(sym.name());
Expand Down

0 comments on commit c8c2294

Please sign in to comment.