cake icon indicating copy to clipboard operation
cake copied to clipboard

Endless loop when including system includes

Open mingodad opened this issue 1 year ago • 3 comments

While trying to parse a Lua-5.4.6 amalgamation I found that cake enter an endless loop trying to insert /usr/include/x86_64-linux-gnu/sys/signal.h that has this content:

#include <signal.h>

And cake was looking first in the current folder before trying the system includes.

This fix https://github.com/mingodad/cake/commit/259da20e924c315c2651efd8880bd8f2a863589f seems to fix the problem but probably it needs a deep inspection.

mingodad avatar Feb 25 '24 11:02 mingodad

I am afraid this bug is caused by error in pragma once.

thradams avatar Feb 25 '24 11:02 thradams

This fix https://github.com/mingodad/cake/commit/b429420c939a0754cd87a6d1c34ae2f20b4c8b26 several memory use after free detected by valgrind and allow to parse an amalgamation of Lua-5.4.6 (see attached) till the end (showing a lot of errors) without crash. am-lua-5.4.6.c.zip

mingodad avatar Feb 25 '24 11:02 mingodad

It also now parse sqlite3.c till the end (with lots of errors) without crash.

mingodad avatar Feb 25 '24 11:02 mingodad