Skip to content
Open
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
8 changes: 7 additions & 1 deletion core/vm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,9 @@ class Interpreter {

bool filled;
otherJsonToHeap(j, filled, scratch);
} catch (const json::parse_error &e) {
} catch (const json::exception &e) {
// parse_error and out_of_range (e.g. 1E999) must become RuntimeError,
// not escape to libjsonnet's CATCH and abort. See #1337.
throw makeError(loc, e.what());
}

Expand Down Expand Up @@ -1737,6 +1739,10 @@ class Interpreter {
}
} catch (const RapidYamlError& exc) {
throw makeError(loc, exc.msg_);
} catch (const json::exception &e) {
// RapidYAML may emit JSON text that json::parse rejects with
// out_of_range (number overflow), not only parse_error. See #1337.
throw makeError(loc, e.what());
}
bool filled_unused;
otherJsonToHeap(j, filled_unused, scratch);
Expand Down
Loading