Commit a0b1f414 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

Dwarf: Ensure block length is encoded correctly

This is supposed to be encoded with ULEB128 which the previous
implementation would only guarranty with short lengths. This likely
holds in nearly all cases, but I'd really rather not take changes.

I fix this using the `.uleb128` directive. I'm not certain that this is
portable across assemblers but it makes this quite straightforward and
at the moment I value correctness over portability.

Test Plan: Compare implementation to DWARF spec

Reviewers: scpmw, austin

Reviewed By: austin

Subscribers: thomie

Differential Revision:
parent a98815a9
......@@ -383,7 +383,7 @@ pprUnwindExpr spIsCFA expr
pprE (UwPlus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_plus
pprE (UwMinus u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_minus
pprE (UwTimes u1 u2) = pprE u1 $$ pprE u2 $$ pprByte dW_OP_mul
in ptext (sLit "\t.byte 1f-.-1") $$
in ptext (sLit "\t.uleb128 1f-.-1") $$ -- DW_FORM_block length
pprE expr $$
ptext (sLit "1:")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment