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

Re: [csmith-dev] (no subject)



Hi,

Csmith already supports 'goto' statement. What's you motivation to generate a specific style of 'goto' statement?

You are generating 'goto' statement that jumps to a label that outside the function, and that caused compiler errors, is my understanding correct?  "find_contained_labels" was introduced to prevent that from happening.

I haven't get time to read your code yet. But I hope my comments help.

Regards,
-Xuejun

On Wed, Aug 1, 2018 at 7:26 AM, sameeran joshi <gsocsameeran@gmail.com> wrote:
hi,
we have been working on adding a computed goto extension to csmith code base as,
void foo(void){
void *target[] ={&&label1,&&label2};
...code
label1:
        ...code
     goto *target[0];
label2:
      ....code
          goto *target[1];

}

in printing the array of address of labels at the start of function,
the find_contained_labels() function from the Statement.cpp is called
and the labels inside the main block of function are stored in a
vector datastructure.
The elements inside the array,while the array contains the labels
which are not even the function.
Following is .diff file and sample code file attached (   func_20()
) is getting error in it.
Thanks,
Sameeran Joshi
Shubham Narlawar