do not overwrite cuInfo->low, it's the base of a range - #11
Conversation
|
The would revert parts of 742f4ec, which I vaguely remember was needed for some debug infos I encountered. |
|
But the code right now overrides the lowpc from the CU. If the CU lowpc is 0, it will be overwritten with a non-zero low from a range. This is a common case. I could probably provide a test that reproduces the range base bug. Why do you need the minimum and maximum when you can simply iterate over a range. Is it for performance reasons? I can provide them separately instead of overwriting the range base, although as I said I benchmarked it. |
I wasn't aware that lowpc could be 0, so yes, I would like to see how to reproduce that. |
|
I pushed a new commit with the test to this branch oltolm@54c1842. If you build with CMake, just run |
The code overwrites
cuInfo->lowwith alowfrom a rangeand then uses
cuInfo->lowas the base of a rangeThat is not correct. The base of a range, according to spec, must be
lowpcfrom a CU. This code is an optimization that has no influence on the runtime, I tested it. The patch simply removes the code.I would also remove code like
dwarf_lowhighpcdoes not change its out parameters in case of an error, so it's unnecessary defensive programming.