Skip to content

Section offsets are 1-indexed #124

@jan-auer

Description

@jan-auer

#93 improved module references by using optional 0-based usize indexes instead of requiring to subtract 1 to resolve modules. In #93 (comment), @mstange points out that same is true for PdbInternalSectionOffset::section:

it was a section index, not a module index. sections.get((section_index - 1) as usize)

The most common usage for section offsets so far was to convert them to RVAs via an OMAP. Internally, this ran the checked sub (going back to #87):

https://github.com/willglynn/pdb/blob/e1b86a2c5c8e2c20dc0be9909baecaf1fdf0aa8a/src/omap.rs#L440-L441

However, since there are other direct uses of the section offset, it would be safer to make section: Option<usize> as well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions