On 03/07/2017 21:46, Richard Henderson wrote:
> On 07/03/2017 09:34 AM, Paolo Bonzini wrote:
>> -extern int tcg_tb_size;
>> +extern unsigned long tcg_tb_size;
>
> size_t would be more natural.
>
> I don't think we support any hosts for which sizeof(size_t) !=
> sizeof(unsigned long), but perhaps
There's Win64... Another place where to do the range check
could be tcg_exec_init. That's where the actual bug lies.
The previous code's error handling was even worse, since strtol's output
was completely unchecked. tcg_exec_init can be fixed later.
Paolo
> unsigned lomg tmp;
> if (qemu_strtoul(optarg, NULL, 0, &tmp) < 0
> || tmp != (size_t)tmp) {
> error_report("Invalid argument to -tb-size");
> exit(1);
> }
> tcg_tb_size = tmp;
>
> where I'd expect the extra comparison to be optimized away.
>
> But I'm not overly concerned either way, so
>
> Reviewed-by: Richard Henderson <[email protected]>
>
>
> r~