Mercurial > hg > octave-terminal
changeset 14564:a459d42bb0a6
Return an error exit code to shell when eval'ed code fails a memory allocation.
octave.cc (execute_eval_option_code, safe_source_file): Set error_state variable
to -2 when bad_alloc exception encountered.
author | Rik <octave@nomad.inbox5.com> |
---|---|
date | Sat, 14 Apr 2012 19:33:45 -0700 |
parents | c973d4637659 |
children | 98aaebc56d7c |
files | src/octave.cc |
diffstat | 1 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/octave.cc +++ b/src/octave.cc @@ -317,6 +317,7 @@ catch (std::bad_alloc) { recover_from_exception (); + error_state = -2; gripe_safe_source_exception (file_name, "memory exhausted or requested size too large for range of Octave's index type"); @@ -443,6 +444,7 @@ } catch (std::bad_alloc) { + error_state = -2; std::cerr << "error: memory exhausted or requested size too large for range of Octave's index type -- eval failed" << std::endl; }