summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-xref.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2015-09-28 15:24:00 +0100
committerRobin Watts <robin.watts@artifex.com>2015-09-30 17:35:42 +0100
commit1f15bade3112bfdc8ddbae9c4b06047427c2367f (patch)
tree3a7b21fd984e2b16040939fbab6022e0fe7f12cd /source/pdf/pdf-xref.c
parent399a04b4af991c71826ce0e6962a23b4f8fa127d (diff)
downloadmupdf-1f15bade3112bfdc8ddbae9c4b06047427c2367f.tar.xz
Bug 696115: Further fix for setjmp/longjmp.
Tor turned up an interesting section in the C spec about this. See page 275 of http://open-std.org/jtc1/sc22/wg14/www/docs/n1494.pdf regarding acceptable places for setjmp to occur. It seems that: if (setjmp(buf)) if (!setjmp(buf)) if (setjmp(buf) {==,!=,<,>} <integer constant>) etc are all valid things to do, but assignments (and subsequent testing of values) like: if ((code = setjmp(buf)) == 0) are not allowed. Further, it's not even clear that: if (a() && setjmp(buf)) is permissible. We therefore recast the macros into the form: a(); if (setjmp((buf)) == 0) which should be acceptable under the C spec. To keep try atomic, we introduce a block '{{{' around this, along with a matching close block '}}}' in the catch clause. This has the nifty extra effect of giving us a compile time error if we mismatch our try/catches.
Diffstat (limited to 'source/pdf/pdf-xref.c')
0 files changed, 0 insertions, 0 deletions