Hi,

Was writing an application and noticed a bug. The script can be reduced
to the following:

```
#!/bin/tcc -run
#include <time.h>
int main() {
    struct timespec start, current;
    clock_gettime(CLOCK_MONOTONIC, &start); // Segfaults
}
```

When the file is executed, it crashes at the indicated line. If I
explicitly compile the program and run it, it behaves correctly. Also tested
the same script on a glibc based machine and it also didn't crash.

Not sure exactly what's special about the call to `clock_gettime`, but
replacing it with something trivial or a printf avoids the crash.

Arthur

_______________________________________________
Tinycc-devel mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to