Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions core/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2798,11 +2798,11 @@ class Interpreter {
} break;

case FRAME_BUILTIN_FORCE_THUNKS: {
const auto &ast = *static_cast<const Apply *>(f.ast);
const auto &location = f.location;
auto *func = static_cast<HeapClosure *>(f.val.v.h);
if (f.elementId == f.thunks.size()) {
// All thunks forced, now the builtin implementations.
const LocationRange &loc = ast.location;
const LocationRange &loc = location;
const std::string &builtin_name = func->builtinName;
std::vector<Value> args;
for (const auto &p : func->params) {
Expand Down Expand Up @@ -2855,7 +2855,7 @@ class Interpreter {
break;

default:
throw makeError(ast.location,
throw makeError(location,
"native extensions can only take primitives.");
}
}
Expand All @@ -2864,7 +2864,7 @@ class Interpreter {
args3.push_back(&args2[i]);
}
if (nit == nativeCallbacks.end()) {
throw makeError(ast.location,
throw makeError(location,
"unrecognized builtin name: " + builtin_name);
}
const VmNativeCallback &cb = nit->second;
Expand All @@ -2878,18 +2878,18 @@ class Interpreter {
} else {
if (r->kind != JsonnetJsonValue::STRING) {
throw makeError(
ast.location,
location,
"native extension returned an error that was not a string.");
}
std::string rs = r->string;
throw makeError(ast.location, rs);
throw makeError(location, rs);
}

} else {
// Not all arguments forced yet.
HeapThunk *th = f.thunks[f.elementId++];
if (!th->filled) {
stack.newCall(ast.location, th, th->self, th->offset, th->upValues);
stack.newCall(location, th, th->self, th->offset, th->upValues);
ast_ = th->body;
goto recurse;
} else {
Expand Down
Loading