Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/system/lib/compiler-rt/emscripten_exception_builtins.c
6162 views
1
/*
2
* Copyright 2018 The Emscripten Authors. All rights reserved.
3
* Emscripten is available under two separate licenses, the MIT license and the
4
* University of Illinois/NCSA Open Source License. Both these licenses can be
5
* found in the LICENSE file.
6
*
7
* Support functions for emscripten setjmp/longjmp and exception handling
8
* support. References to the things below are generated in the LLVM backend.
9
* See: https://llvm.org/doxygen/WebAssemblyLowerEmscriptenEHSjLj_8cpp.html
10
*/
11
12
#include <stdint.h>
13
#include <threads.h>
14
15
#include "emscripten_internal.h"
16
17
thread_local uintptr_t __THREW__ = 0;
18
thread_local int __threwValue = 0;
19
20
void setThrew(uintptr_t threw, int value) {
21
if (__THREW__ == 0) {
22
__THREW__ = threw;
23
__threwValue = value;
24
}
25
}
26
27