Skip to content

Commit

Permalink
Improved error reporting on invalid constant pool index
Browse files Browse the repository at this point in the history
This will allow easy deduction of whether the invalid index comes from
some constant not being loaded (probably only slightly invalid) or
reading an irreveant byte when trying to read a constant pool index
(much larger than the constant pool size).
  • Loading branch information
thk123 committed Feb 5, 2018
1 parent a619e48 commit 6fe1808
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/java_bytecode/java_bytecode_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class java_bytecode_parsert:public parsert
if(index==0 || index>=constant_pool.size())
{
error() << "invalid constant pool index (" << index << ")" << eom;
error() << "constant pool size: " << constant_pool.size() << eom;
throw 0;
}

Expand Down

0 comments on commit 6fe1808

Please sign in to comment.