Assertion in symbol table due to Revision 8881
Daniel J Sebald
daniel.sebald at ieee.org
Tue Jun 30 22:05:27 CDT 2009
Jaroslav Hajek wrote:
> On Mon, Jun 29, 2009 at 8:10 AM, Daniel J Sebald<daniel.sebald at ieee.org> wrote:
[snip]
>>The actual note is
>>
>>octave: symtab.h:1066 : static void symbol_table::force_variable(cost
>>std::string&, int, size_t): Assertion
>>`xcurrent_context == 0' failed.
>>panic: Aborted -- stopping myself...
>>attempting to save variables to 'octave-core'...
>>save to 'octave-core' complete
>>Aborted
>>
>>Version 3.1.53 works fine.
>>
>>Dan
>>
>>
>
>
> Hmm, I don't see why the assertion is valid. Surely force_variable
> *can* be executed in nonzero context (i.e. recursive call), using
> eval, as your example shows.
>
> Another example is
>
> function testf2(n)
> if (n > 0)
> testf2 (n-1);
> else
> eval(["a = ", num2str(n)]);
> endif
>
>
> octave:1> testf2(3)
>
> Since it doesn't seem to break anything, I've removed the assertion:
> http://hg.savannah.gnu.org/hgweb/octave/
OK, but I'm wondering what the intent of the 'xcurrent_context == 0' test was. Ensuring that a passed-in variable is a particular value doesn't make sense; why pass in such a variable? Just use its value. Perhaps the test was intended to be 'xcurrent_context >= 0'? I just want to make sure that we aren't leaving out a check on some kind of stack operation that might be difficult to find at a later date.
Dan
More information about the Octave-maintainers
mailing list