Thread overview
Bug: Segfault when trying to get a pointer to a non-existent func
Oct 04, 2002
Russell Lewis
Oct 04, 2002
Burton Radons
Oct 04, 2002
Russell Lewis
October 04, 2002
The code below is obviously a syntax error.  The compiler (DLI 0.1.1) recognizes that the identifier doesn't exist, but then later crashes.

  int main() {
    void (*callback)(int) = &NoSuchFunc;
    return 0;
  }

October 04, 2002
Russell Lewis wrote:
> The code below is obviously a syntax error.  The compiler (DLI 0.1.1) recognizes that the identifier doesn't exist, but then later crashes.
> 
>   int main() {
>     void (*callback)(int) = &NoSuchFunc;
>     return 0;
>   }

That's my way of giving multiple error messages - I don't exit on the first one.  Since DMD expects that the error function exits the program, it often does things like sets objects to NULL that it later calls.

I need to go through the code some time, identify all the errors, and make sure it doesn't destroy itself.  It's on the TODO.

October 04, 2002
Burton Radons wrote:
> Russell Lewis wrote:
> 
>> The code below is obviously a syntax error.  The compiler (DLI 0.1.1) recognizes that the identifier doesn't exist, but then later crashes.
>>
>>   int main() {
>>     void (*callback)(int) = &NoSuchFunc;
>>     return 0;
>>   }
> 
> 
> That's my way of giving multiple error messages - I don't exit on the first one.  Since DMD expects that the error function exits the program, it often does things like sets objects to NULL that it later calls.
> 
> I need to go through the code some time, identify all the errors, and make sure it doesn't destroy itself.  It's on the TODO

k.  I'll make a mental note not to report any more "second errors" as bugs.  Hope I don't lose it.

Huh?  What were we talking about again? :p