| Summary: | wrong boundary computation in compute_reverse_lookup_indices | ||
|---|---|---|---|
| Product: | [Tools] TCF | Reporter: | Christophe Augier <christophe.augier> |
| Component: | Core | Assignee: | Project Inbox <tcf.core-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | eugene |
| Version: | unspecified | Flags: | eugene:
iplog+
|
| Target Milestone: | 0.4.0 | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| Whiteboard: | |||
I have committed the patch. Thanks! |
in compute_reverse_lookup_indices, following patch fixes the problem. --- services/dwarfcache.c (revision 1361) +++ services/dwarfcache.c (working copy) @@ -816,9 +816,9 @@ Unit->mStatesIndex = (LineNumbersState **)loc_alloc(sizeof(LineNumbersState *) * Unit->mStatesCnt); for (i = 0; i < Unit->mStatesCnt; i++) Unit->mStatesIndex[i] = Unit->mStates + i; qsort(Unit->mStatesIndex, Unit->mStatesCnt, sizeof(LineNumbersState *), state_text_pos_comparator); - for (i = 0; i < Unit->mStatesCnt - 1; i++) { - LineNumbersState * s = Unit->mStatesIndex[i]; - LineNumbersState * n = Unit->mStatesIndex[i + 1]; + for (i = 1; i < Unit->mStatesCnt; i++) { + LineNumbersState * s = Unit->mStatesIndex[i - 1]; + LineNumbersState * n = Unit->mStatesIndex[i]; s->mNext = n - Unit->mStates; } }