[DTrace-devel] [PATCH v2 05/13] Handle steps==0 error for llquantize

Eugene Loh eugene.loh at oracle.com
Wed Dec 9 13:20:08 PST 2020


On 12/08/2020 10:22 AM, Kris Van Hees wrote:

> On Tue, Dec 08, 2020 at 12:19:23PM -0500, eugene.loh at oracle.com wrote:
>> From: Eugene Loh <eugene.loh at oracle.com>
>>
>> Specifying steps==0 was giving divide-by-zero failures.
>>
>> diff --git a/libdtrace/dt_cg.c b/libdtrace/dt_cg.c
>> @@ -3208,6 +3208,11 @@ dt_cg_agg_llquantize(dt_pcb_t *pcb, dt_ident_t *aid, dt_node_t *dnp,
>>   		dnerror(arg4, D_LLQUANT_STEPTYPE, "llquantize( ) argument #4 "
>>   			"must be an integer constant\n");
>>   
>> +	if (!dt_node_is_posconst(arg4))
>> +		dnerror(arg4, D_LLQUANT_STEPTYPE, "llquantize( ) "
>> +		       "argument #4 must be a non-zero positive "
>> +		       "integer constant\n");
>> +
> I should have added one extra comment...  You can get rid of the preceding
> test for arg4 being an integer constant because that is covered in this new
> one alreasy.
Oops.  I overlooked this in my inbox (and in the code too;  I should 
have caught this).  Sorry.  Just posted a patch v3.



More information about the DTrace-devel mailing list