mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
Explorer: Fuzzer issue around infinite recursion (#2741)
I limited the stack size to 1K we can change it or make it dynamic from CLI later Closes #2733
This commit is contained in:
@@ -952,6 +952,10 @@ auto Interpreter::CallFunction(const CallExpression& call,
|
||||
Nonnull<const Value*> fun,
|
||||
Nonnull<const Value*> arg,
|
||||
ImplWitnessMap&& witnesses) -> ErrorOr<Success> {
|
||||
constexpr int StackSizeLimit = 1000;
|
||||
if (todo_.Count() > StackSizeLimit) {
|
||||
return ProgramError(call.source_loc()) << "stack overflow";
|
||||
}
|
||||
if (trace_stream_->is_enabled()) {
|
||||
*trace_stream_ << "calling function: " << *fun << "\n";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user