Thread_local for return variable.

Jan 16, 2013 at 12:21 PM
Edited Jan 17, 2013 at 3:10 PM

Hi all,

we distilled this code:

#include <vcc.h>

void change(char** in, int* size){ //...
}

char* res(char* in, int size){
	char* tmp;

	change(&in, &size);
	
	return in;
}

It fails verification with "...thread_local failed to verify" in the return line of function res. Changing the code to:

char* res(char* in, int size){
	char* tmp;

	change(&in, &size);
        
        tmp = in;
	return tmp;
}

Verifies without complaining.

The question is: what are we missing? Adding the respective _(requires \thread_local...) does not seem to help, but writing into a local variable does.

Thanks a lot!

Sergio

Developer
Jan 27, 2013 at 2:26 PM

This looks like a bug. At least you have a workaround for the present.