Commit Graph

1 Commits

Author SHA1 Message Date
Frederic Riss
f87dc438fd [MCDwarf] Fix encoding of line tables with weird custom parameters
With poorly chosen custom parameters, the line table encoding logic would
sometimes end up generating a special opcode bigger than 255, which is wrong.
The set of default parameters that LLVM uses isn't subject to this bug.

When carefully chosing the line table parameters, it's impossible to fall into the
corner case that this patch fixes. The standard however doesn't require that these
parameters be carefully chosen. And even if it did, we shouldn't generate broken
encoding.

Add a unittest for this specific encoding bug, and while at it, create some unit
tests for the encoding logic using different sets of parameters.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@259334 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-31 22:06:35 +00:00