ge...@gnu.org writes: > Hi all, > > If I understand correctly the following lines (1498 and 1511) from > pdf-fp-func.c > aren't considering the case when "stack[sp] == 0". > ## > case OPC_div: > if (sp < 1) goto stack_underflow; > stack[sp-1] /= stack[sp]; > sp--; > break; > > [...] > > case OPC_idiv: > if (sp < 1) goto stack_underflow; > if (!INT_P(stack[sp]) || !INT_P(stack[sp-1])) > goto type_error; > stack[sp-1] = INT(stack[sp]) / INT(stack[sp-1]); > sp--; > break; > ### > > > Is that a bug ? >
Hi gerel, It seems. I think there is similar errors (e.g: sqrt operand works on real numbers and it does not check their parameter to be non-negative). I am working on error management in type 4 functions. I think it would be better finish this task first. Then, we can take a look to these commands in the Postscript language reference, and check to it handles errors correctly.