• Leszek Swirski's avatar
    [modules] Make exported variable indices stable · e39b90f6
    Leszek Swirski authored
    A module's exported variables are assigned a cell index based on their
    order in the exported variable map. This map is keyed by the variable
    name, an AstRawString*.
    
    Unfortunately, these string pointers are not guaranteed to increase
    monotonically as variables are encountered, which means that this map
    isn't stable across parses. In particular, it can cause failures for
    setVariableValue if the parser is unlucky.
    
    This patch adds a custom comparator to these AstRawString* keyed maps,
    which is stable across parses.
    
    Change-Id: Ie6e88fc2d252d873de661d7fc5278feba3955727
    Reviewed-on: https://chromium-review.googlesource.com/1131503Reviewed-by: 's avatarToon Verwaest <verwaest@chromium.org>
    Commit-Queue: Leszek Swirski <leszeks@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#54379}
    e39b90f6
modules.h 8.96 KB