diff options
author | Josh Haberman <jhaberman@gmail.com> | 2015-08-11 17:46:31 -0700 |
---|---|---|
committer | Josh Haberman <jhaberman@gmail.com> | 2015-08-11 17:46:31 -0700 |
commit | 85440108e502b6f58671fcfc4b84103d1a716253 (patch) | |
tree | 87c6b186feb7b89fb84b3125653b0fe2d7ade339 /upb/pb/compile_decoder_x64.dasc | |
parent | fe427341f29a31656e247ef528adbab5ad786c9e (diff) |
More decoder fixes, and slightly changed parse call semantics.
Prior to this change, if an error was returned, it would be
guaranteed to always return a short byte count. Now the two
concepts are a bit more orthogonal. There are cases where
the entire input is consumed even though an error was
encountered.
Diffstat (limited to 'upb/pb/compile_decoder_x64.dasc')
-rw-r--r-- | upb/pb/compile_decoder_x64.dasc | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/upb/pb/compile_decoder_x64.dasc b/upb/pb/compile_decoder_x64.dasc index dfc9597..edda7dd 100644 --- a/upb/pb/compile_decoder_x64.dasc +++ b/upb/pb/compile_decoder_x64.dasc @@ -300,7 +300,7 @@ static void emit_static_asm(jitcompiler *jc) { | mov rcx, DELIMEND | sub rcx, PTR | sub rcx, rdx - | jb ->err // Len is greater than enclosing message. + | jb >4 // Len is greater than enclosing message. | mov FRAME->end_ofs, rcx | cmp FRAME, DECODER->limit | je >3 // Stack overflow @@ -319,7 +319,7 @@ static void emit_static_asm(jitcompiler *jc) { |2: | ret |3: - | // Error -- call seterr. + | // Stack overflow error. | mov PTR, DECODER->checkpoint // Rollback to before the delim len. | // Prepare seterr args. | mov ARG1_64, DECODER @@ -327,6 +327,15 @@ static void emit_static_asm(jitcompiler *jc) { | callp upb_pbdecoder_seterr | call ->suspend | jmp <1 + |4: + | // Overextended len. + | mov PTR, DECODER->checkpoint // Rollback to before the delim len. + | // Prepare seterr args. + | mov ARG1_64, DECODER + | ld64 kPbDecoderSubmessageTooLong + | callp upb_pbdecoder_seterr + | call ->suspend + | jmp <1 | | // For getting a value that spans a buffer seam. Falls back to C. |.macro getvalue_slow, func, bytes |