diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-03-01 15:25:43 +0000 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2012-03-01 15:30:34 +0000 |
commit | c6aa389a2c3430396a5e818bbb849410ab29d617 (patch) | |
tree | f1a46dbe7eb2dcedc463a2281b8f41db6102d3f6 | |
parent | 152ce17e73ab54e0f619ec2088b34a4a5e53f421 (diff) | |
download | mupdf-c6aa389a2c3430396a5e818bbb849410ab29d617.tar.xz |
Setjmp/longjmp exception tweaks.
First, fix a couple of the 'alternative formulations' of the
try/catch code in the comments.
Secondly, work around a Mac OS X compiler bug.
-rw-r--r-- | fitz/fitz.h | 4 | ||||
-rw-r--r-- | pdf/pdf_parse.c | 7 |
2 files changed, 5 insertions, 6 deletions
diff --git a/fitz/fitz.h b/fitz/fitz.h index 825ed4ba..f72aecb9 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -210,7 +210,7 @@ execution. Again this was felt to be too high a cost to use. #define fz_always(ctx) \ } while (0); \ - longjmp(ctx->error->stack[ctx->error->top].buffer, 3); \ + fz_longjmp(ctx->error->stack[ctx->error->top].buffer, 3); \ } \ else if (ctx->error->stack[ctx->error->top].code & 1) \ { do { @@ -218,7 +218,7 @@ execution. Again this was felt to be too high a cost to use. #define fz_catch(ctx) \ } while(0); \ if (ctx->error->stack[ctx->error->top].code == 1) \ - longjmp(ctx->error->stack[ctx->error->top].buffer, 2); \ + fz_longjmp(ctx->error->stack[ctx->error->top].buffer, 2); \ ctx->error->top--;\ } \ else if (ctx->error->top--, 1) diff --git a/pdf/pdf_parse.c b/pdf/pdf_parse.c index e171e698..57ba1d6f 100644 --- a/pdf/pdf_parse.c +++ b/pdf/pdf_parse.c @@ -313,19 +313,18 @@ end: pdf_obj * pdf_parse_dict(pdf_document *xref, fz_stream *file, pdf_lexbuf *buf) { - pdf_obj *dict = NULL; + pdf_obj *dict; pdf_obj *key = NULL; pdf_obj *val = NULL; int tok; int a, b; fz_context *ctx = file->ctx; - fz_var(dict); + dict = pdf_new_dict(ctx, 8); + fz_var(key); fz_var(val); - dict = pdf_new_dict(ctx, 8); - fz_try(ctx) { while (1) |