appleseedlab / maki

A tool for analyzing syntactic and semantic properties of C Preprocessor macros in C programs
8 stars 3 forks source link

`IsAnyArgument` property checks are incorrect #56

Closed PappasBrent closed 2 months ago

PappasBrent commented 2 months ago

While writing #55 I made an unfortunate discovery: Maki's IsAnyArgument series of property checks appear to mostly be incorrect. For each IsAnyArgument property, the value of the property is assigned to whether that property is true for the last argument, not any argument. For instance, for the following macro:

#define FOO(A, B) (A, B)
void bar(void) { }
int baz(void) { return 1; }

int main(void) {
    FOO(bar(), baz());
    return 0;
}

The IsAnyArgumentTypeVoid property is set to false, when it should be set to true.

This is as easy fix: We just need to or-equal the value of each IsAnyArgument property to the result of the corresponding check for each macro argument, instead of assigning directly (which is what we currently do).