Whenever you are working with an ABC file and loading it in to the AVM, the AVM will validate the ABC on the way in. I ran in to an issue tonight where I was dynamically weaving the opcodes for a method in Loom, and I forgot to add a NamespaceSet to the ConstantPool. If you do something like this, you end up with this rather nondescript error.
Now, in fairness, the AVM does tell you that there is a problem with the constant pool and it does tell you which index it can’t find. If your index was 6 for example (which my one was), it means that one of the parts of your ABC file references the seventh item in a pool that has less than seven items (since the code in the AVM is written in C++ and is 0-based for collection indices). Typically this would not be confusing for a programmer, but the ABC code starts at 1-based positions for all the constant pools, and after thinking that way for a while you can get tricked by error messages that don’t indicate what the starting loop position is.
Hopefully you won’t run in to this issue, but if you do, now you’ll know why.
Post a Comment