octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #35772] Nested Function Support


From: Alon Levy
Subject: [Octave-bug-tracker] [bug #35772] Nested Function Support
Date: Sat, 17 Mar 2012 22:21:42 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20100101 Firefox/10.0.1

Follow-up Comment #7, bug #35772 (project octave):

Hi Max,

 I've tested your patch, I found two issues so far:

1. clear all removes the nested functions. Example that fails with unresolved
function sub:
function f();
# 1
function sub();
endfunction
# 2
clear all
sub() # fails, unresolved symbol
endfunction

f()
error: `sub' undefined near line 5 column 1
error: called from:
error:   f at line 5, column 1

2. segmentation fault with an almost identical code to the above (just moving
clear all from #2 to #1):

function f();
# 1
clear all
function sub();
endfunction
# 2
sub() # fails, unresolved symbol
endfunction

f()


#0  0x0000000000000041 in ?? ()
#1  0x00007fd910b0c1a1 in tree_evaluator::visit_function_def (this=<optimized
out>, cmd=...) at ../../src/pt-eval.cc:515
#2  0x00007fd910b0b525 in tree_evaluator::visit_statement
(this=0x7fd911224bf8, stmt=...) at ../../src/pt-eval.cc:706
#3  0x00007fd910b0ad0e in visit_statement_list (lst=..., this=0x7fd911224bf8)
at ../../src/pt-eval.cc:772
#4  tree_evaluator::visit_statement_list (this=0x7fd911224bf8, lst=...) at
../../src/pt-eval.cc:753
#5  0x00007fd910a92013 in octave_user_function::do_multi_index_op
(this=0x1104e00, nargout=0, args=..., lvalue_list=<optimized out>) at
../../src/ov-usr-fcn.cc:479
#6  0x00007fd910a8f1ff in octave_user_function::subsref (this=0x1104e00,
type="(", idx=Python Exception <type 'exceptions.IndexError'> list index out
of range:
std::list, nargout=0, address@hidden) at
../../src/ov-usr-fcn.cc:329
#7  0x00007fd910a8f3cc in octave_user_function::subsref (this=<optimized out>,
type=..., idx=..., nargout=<optimized out>) at ../../src/ov-usr-fcn.cc:312
#8  0x00007fd910a9c638 in octave_value::subsref (this=<optimized out>,
type=..., idx=..., nargout=<optimized out>) at ../../src/ov.cc:1203
#9  0x00007fd910a9c6a5 in octave_value::subsref (this=<optimized out>,
type=..., idx=..., nargout=<optimized out>, lvalue_list=<optimized out>) at
../../src/ov.cc:1214
#10 0x00007fd910b132eb in tree_index_expression::rvalue (this=<optimized out>,
nargout=0, address@hidden) at ../../src/pt-idx.cc:414
#11 0x00007fd910b13a3b in tree_index_expression::rvalue (this=<optimized out>,
nargout=<optimized out>) at ../../src/pt-idx.cc:284
#12 0x00007fd910b114b8 in tree_index_expression::rvalue1 (this=0x11026a0,
nargout=0) at ../../src/pt-idx.cc:425
#13 0x00007fd910b0b5f4 in tree_evaluator::visit_statement
(this=0x7fd911224bf8, stmt=...) at ../../src/pt-eval.cc:736
#14 0x00007fd910b0ad0e in visit_statement_list (lst=..., this=0x7fd911224bf8)
at ../../src/pt-eval.cc:772
#15 tree_evaluator::visit_statement_list (this=0x7fd911224bf8, lst=...) at
../../src/pt-eval.cc:753
#16 0x00007fd9109aed34 in main_loop () at ../../src/toplev.cc:595
#17 0x00007fd91095689f in octave_main (argc=1, argv=<optimized out>,
embedded=0) at ../../src/octave.cc:943
#18 0x00000039c2421735 in __libc_start_main (main=0x400750 <main>, argc=1,
ubp_av=0x7fff71c7b338, init=<optimized out>, fini=<optimized out>,
rtld_fini=<optimized out>, stack_e
nd=0x7fff71c7b328) at libc-start.c:226
#19 0x0000000000400781 in _start ()

I think this backtrace is almost useless but I need to rebuild with -O0 to
have any parameters. It's just showing a fault during evaluation of the user
function.

Other then that I do need nested function support :(

Thanks for all the great work,
Alon

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?35772>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]