Skip to content

Commit f8e5dd6

Browse files
authored
Fix infinite recursion in test browser.test_webgl_context_major_version. (#26875)
Fix infinite recursion in test browser.test_webgl_context_major_version. abort() calls to err(), and the test would overwrite err() to call to abort(). The test would pass, but only after throwing ``` [890/960] test_webgl_context_major_version (test_browser.browser64_4gb.test_webgl_context_major_version) ... JavaScript error: http://localhost:8888/test.js, line 193: InternalError: too much recursion JavaScript error: http://localhost:8888/test.js, line 193: InternalError: too much recursion JavaScript error: http://localhost:8888/test.js, line 193: InternalError: too much recursion JavaScript error: http://localhost:8888/test.js, line 193: InternalError: too much recursion ok ``` http://clbri.com:8010/api/v2/logs/420471/raw_inline
1 parent 4a91be3 commit f8e5dd6

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

test/browser/test_webgl_context_major_version.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,13 @@ int main() {
1414
EMSCRIPTEN_WEBGL_CONTEXT_HANDLE context;
1515
// turn the error call into abort so that it can be detected by the test
1616
EM_ASM({
17-
err = (msg) => { abort(`Expected Error: ${msg}`); }
17+
var originalErr = err;
18+
err = (msg) => {
19+
// Restore original err() to avoid infinite recursion, because abort() will
20+
// print to err().
21+
err = originalErr;
22+
abort(`Expected Error: ${msg}`);
23+
}
1824
});
1925
context = emscripten_webgl_create_context("#canvas", &attrs);
2026
assert(context);

0 commit comments

Comments
 (0)