Thread overview | |||||
---|---|---|---|---|---|
|
October 04, 2002 Bug: Segfault when trying to get a pointer to a non-existent func | ||||
---|---|---|---|---|
| ||||
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 Re: Bug: Segfault when trying to get a pointer to a non-existent func | ||||
---|---|---|---|---|
| ||||
Posted in reply to Russell Lewis | 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 Re: Bug: Segfault when trying to get a pointer to a non-existent func | ||||
---|---|---|---|---|
| ||||
Posted in reply to Burton Radons | 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
|
Copyright © 1999-2021 by the D Language Foundation