#include "AST.h" #include "CodeContext.h" CodeLiteralNode TryStmtNode::popState( "*pexn_state = state.prior;" ); void TryStmtNode::emitStatement( CodeContext &context ) { CodeContext subcontext( context ); subcontext << " struct ExceptionState **pexn_state = &PERPROC_REF(exception_state);" << endCline << " struct ExceptionState state;" << endCline << " state.prior = *pexn_state;" << endCline << " state.handling = 0;" << endCline << " TO_LOCAL(state.value) = NULL;" << endCline << " *pexn_state = &state;" << endCline << endCline << " if (!SETJMP( state.handler ))" << endCline; { CodeContext blockContext( subcontext ); block()->codeGen( blockContext ); } catches()->codeGen( subcontext ); popState.codeGen( subcontext ); finally()->codeGen( subcontext ); subcontext << "if (nonNull(state.value)) toss( state.value );" << endCline; }