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

Re: [csmith-dev] generating unknown labels.





On Thu 2 Aug, 2018, 5:15 AM Xuejun Yang, <nitsnow@gmail.com> wrote:
Hi,

Csmith already supports 'goto' statement. What's you motivation to generate a specific style of 'goto' statement?
We are working on extending csmith for gcc C language extensions.So we are trying for computed goto extensions.

You are generating 'goto' statement that jumps to a label that outside the function, and that caused compiler errors, is my understanding correct? 
No,we are trying to first create and diaplay all the labels inside the function,where we are getting unknown labels.
"find_contained_labels" was introduced to prevent that from happening.
This method will fill the vector passed to it as a parameter with the labels inside the block,right?

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