On Sat, 8 Mar 2008, Arne Goedeke wrote:
Also with this particular case (when the first constant is wrong), pike segfaults, apparently in f_function_name called by _sprintf in the last backtrace frame of that compile error.
I looked into it again and the problem seems to be that in interpret.c:apply_low_safe_and_stupid() a dummy identifier_reference pointing to the first identifier is added to the program when trying to evaluate the constant expression. At that time however there are no identifiers in that program, yet. During the evaluation an error is thrown and f_function_name tries to access an uninitialized identifier pointed to by that reference.
Its possible to fix the segfault by changing use_dummy_reference to
int use_dummy_reference = !o->prog->num_identifier_references && o->prog->num_identifiers;
but I simply dont know if there are cases where that doesnt work.
arne