Start checking for a few possible resource exhaustion scenarios for explorer (#2793)

I couldn't figure out a way to actually hit a reasonable out-of-memory case once I add the maximum interpreter step count. However, the step count limit seems more important.

I've moved the todo stack limit out of function calls because there are plenty of ways to build up the todo stack without any function calls.

Fixes #2791
This commit is contained in:
Jon Ross-Perkins
2023-04-21 15:14:14 -07:00
committed by GitHub
parent f310316ef4
commit b828093c87
10 changed files with 104 additions and 19 deletions
@@ -1,20 +0,0 @@
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// AUTOUPDATE
// RUN: %{not} %{explorer-run}
// RUN: %{not} %{explorer-run-trace}
package EmptyIdentifier impl;
fn A() {
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/testdata/function/fail_recursion_stackoverflow.carbon:[[@LINE+1]]: stack overflow
A();
}
fn Main() -> i32
{
A();
return 0;
}