tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] macro_ptr bugfix doesn't work, preprocess_init called too


From: egodust
Subject: [Tinycc-devel] macro_ptr bugfix doesn't work, preprocess_init called too late
Date: Sun, 27 Apr 2008 21:18:48 +0100

Heyas,

I just saw the latest CVS changes to tcc.c,

preprocess_init() now sets macro_ptr = NULL and it's called by
tcc_compile() among others,
the problem is, macro_ptr != NULL and is used during tcc_new()
*before* tcc_compile()

When tcc_new() is called after a bad compile, macro_ptr will cause
tcc_define_symbol()
to throw an error, preprocess_init()

tcc_new() should call preprocess_init() also?

// -- test program ---------
#include "libtcc.h"

int main()
{
        TCCState * tcc = tcc_new();
        tcc_add_file(tcc, "bad.c");
        tcc_delete(tcc);
        
        tcc=tcc_new();  // error about invalid macro
        tcc_delete(tcc);
        
        return 0;
}

// bad.c ----

void bar()
{
        this_is_bad
}

int main()
{
        bar();
}

Kind Regards,
Sam K




reply via email to

[Prev in Thread] Current Thread [Next in Thread]