Closed bluejekyll closed 2 years ago
@staktrace, let me know if there's anything else you'd like to see here. Otherwise I think this is complete.
Sorry for the delay. I did start looking at it and had some concerns about the string copies which I generally try to avoid. I haven't had a chance to look more closely yet, but hopefully will get to it in the next day or two.
If the string copies are a really big concern, I can attempt to factor them out. That's going to take some work based on the current lifetime's with Chars, etc, but should be feasible. I'll try and refactor for that.
ok, I removed any unnecessary string allocation. it makes the parsing logic ever so slightly more complex, but in the end not too bad.
let me know if you think there is a simpler way to achieve this.
Thanks for the reviews. I think the last change covers your concerns.
Hm I was looking at the code some more and I realized that the descriptor parsing doesn't properly handle some cases, like arrays with more than 255 dimensions. Those are supposed to be treated as invalid but the descriptor parser is ok with it.
I can put together a patch to catch that case. See: #21
This adds descriptor parsing for both method_info (
MethodDescriptor
) as well as field_info (FieldType
).Fixes: #18