Skip to content

Commit

Permalink
Fix segfault in exiting before JIT actually runs
Browse files Browse the repository at this point in the history
  • Loading branch information
Evan Phoenix committed Feb 8, 2010
1 parent ce306b0 commit 558e3b5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions vm/environment.cpp
Expand Up @@ -382,9 +382,11 @@ namespace rubinius {
}

int Environment::exit_code() {
std::ostream& jit_log = shared->llvm_state->log();
if(jit_log != std::cerr) {
dynamic_cast<std::ofstream&>(jit_log).close();
if(LLVMState* ls = shared->llvm_state) {
std::ostream& jit_log = ls->log();
if(jit_log != std::cerr) {
dynamic_cast<std::ofstream&>(jit_log).close();
}
}

if(state->thread_state()->raise_reason() == cExit) {
Expand Down

0 comments on commit 558e3b5

Please sign in to comment.