You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description:
When Milu generates mutants, in some special cases, Milu will insert an additional ";" symbol between paired if and else statements, causing the mutants failed being compiled.
void main(int argc, char** argv){
func(0);
}
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>
static void func ( int new_state )
{
int * arr = 0 ;
if ( new_state == 0 )
arr = ( int * ) malloc ( 8 ) ;
;
else arr = ( int * ) malloc ( 16 ) ;
;
}
;
void main ( int argc , char * * argv )
{
func ( 0 ) ;
}
4. There is a redundant ";" symbol between the if and the else statement. If you compile this output, the compiler will complain about 'else' without a previous 'if'.
* Temporary Solution for users:*
Put brackets around the if-statement block like this:
if ( new_state==0 )
{ arr = (int *) malloc( 8 ); }
else
arr = (int *) malloc( 16 );
The text was updated successfully, but these errors were encountered:
Bug description:
When Milu generates mutants, in some special cases, Milu will insert an additional ";" symbol between paired if and else statements, causing the mutants failed being compiled.
How to recreate the bug:
include<stdlib.h>
static void func( int new_state )
{
int* arr = 0;
if ( new_state==0 )
arr = (int *) malloc( 8 );
else
arr = (int *) malloc( 16 );
}
void main(int argc, char** argv){
func(0);
}
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>
static void func ( int new_state )
{
int * arr = 0 ;
if ( new_state == 0 )
arr = ( int * ) malloc ( 8 ) ;
;
else arr = ( int * ) malloc ( 16 ) ;
;
}
;
void main ( int argc , char * * argv )
{
func ( 0 ) ;
}
4. There is a redundant ";" symbol between the if and the else statement. If you compile this output, the compiler will complain about 'else' without a previous 'if'.
* Temporary Solution for users:*
Put brackets around the if-statement block like this:
if ( new_state==0 )
{ arr = (int *) malloc( 8 ); }
else
arr = (int *) malloc( 16 );
The text was updated successfully, but these errors were encountered: