[Poppler-bugs] [Bug 63067] Misuse of setjmp in DCTStream

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Apr 4 02:11:29 PDT 2013


https://bugs.freedesktop.org/show_bug.cgi?id=63067

--- Comment #5 from rodrigo <rodrigorivascosta at gmail.com> ---
(In reply to comment #4)
> (In reply to comment #0)
> >     if (!setjmp(err.setjmp_buffer) && jpeg_read_header(&cinfo, TRUE) !=
> > JPEG_SUSPENDED)
> 
> This is NOT a iteration statement, iteration statements are "for", "while"
> and similar!
No, it is a *selection statement*. The other one is 'switch'. If it weren't it
would be even a worst case, because the 'setjmp' specification enumerates the
places where it is allowed to be used, not where it is forbidden.

> Okay, okay, the order of execution of an if condition is undefined in C/C++.

No, that's not the problem. The order of evaluation of an expression is
unspecified, except where otherwise indicated. But the && operator does insert
a sequence point, so the left part is always evaluated before the right one.
The problem is not the order of evaluation but that 'setjmp' is not allowed to
be used here.

> But if we are puristic: Yes, it should be in that way!

I agree that I'm being puristic, but the change costs nothing and may avoid
nasty surprises, particularly in weird architectures. And nasty looks from the
pedantics...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/poppler-bugs/attachments/20130404/6fd50010/attachment.html>


More information about the Poppler-bugs mailing list