Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug Report] Unsupported grammar of sizeof #9

Open
FanWuUCL opened this issue Mar 16, 2016 · 0 comments
Open

[Bug Report] Unsupported grammar of sizeof #9

FanWuUCL opened this issue Mar 16, 2016 · 0 comments
Labels

Comments

@FanWuUCL
Copy link
Collaborator

Bug description:
The sizeof operation in C can be in two forms: "sizeof(var)" or "sizeof var". In the latter case, Milu cannot process such code correctly but print unmatched parenthesis.

How to recreate the bug:

  1. Write the following code to a file, say "bug.c":

include<stdlib.h>

include<stdio.h>

void func()
{
void* msg;
printf("%lu\n", sizeof msg);
if(msg == 0);

}

void main(int argc, char** argv){
func();
}
2. Run Milu to generate mutants on "bug.c", with the default set of operators, but add option "--debug=src":
$ path\to\milu --debug=src bug.c
3. The output will be the original code being parsed and printed without any modification:

include<stdlib.h>

include<stdio.h>

void func ( )
{
void * msg ;
printf ( "%lu\n"
, sizeof msg )
) ;
if ( msg == 0 ) ;

}

;
void main ( int argc , char * * argv )
{
func ( ) ;
}

  1. There is an additional parenthesis after "sizeof msg" in the printf statement.

Temporary Solution for users:
Enclose the argument of sizeof in parentheses.

@FanWuUCL FanWuUCL added the bug label Mar 16, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant