Mercurial > hg > octave-nkf
diff src/octave.cc @ 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 | c67822beb7a4 |
children | 4e9dc46d4125 |
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; }