diff options
author | Adrian Thurston <thurston@complang.org> | 2015-03-21 15:38:40 -0400 |
---|---|---|
committer | Adrian Thurston <thurston@complang.org> | 2015-03-21 15:38:40 -0400 |
commit | aa6ebd4e2fbfc9976a324889e9059d7868ac6545 (patch) | |
tree | 9b14f374b52b9c412b7b1d8615899c77e1b9a518 /src/declare.cc | |
parent | db115fc3205213ba179083c00d2043b6ae3ec102 (diff) | |
download | colm-aa6ebd4e2fbfc9976a324889e9059d7868ac6545.tar.gz |
added exit_hard function, which just calls the system exit
The exit() function will unwind the stack and attempt a graceful exit. Since
the stack unwinding is not 100% funcitonal this sometimes causes segfaults. The
hard exit will not segfault, but forces the process to terminate.
Diffstat (limited to 'src/declare.cc')
-rw-r--r-- | src/declare.cc | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/declare.cc b/src/declare.cc index 01cd8a0d..90622192 100644 --- a/src/declare.cc +++ b/src/declare.cc @@ -943,7 +943,10 @@ void Compiler::declareGlobalFields() method->useCallObj = false; method = initFunction( uniqueTypeInt, globalObjectDef, "exit", - IN_EXIT, IN_EXIT, uniqueTypeInt, true ); + IN_EXIT, IN_EXIT, uniqueTypeInt, true, true ); + + method = initFunction( uniqueTypeInt, globalObjectDef, "exit_hard", + IN_EXIT_HARD, IN_EXIT_HARD, uniqueTypeInt, true, true ); method = initFunction( uniqueTypeInt, globalObjectDef, "system", IN_SYSTEM, IN_SYSTEM, uniqueTypeStr, true ); |