Skip to content

Commit 133fd8c

Browse files
committed
*currp -> curr
1 parent c37dad5 commit 133fd8c

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/parser/wat-parser.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ Result<> parseDefs(Ctx& ctx,
9292
}
9393

9494
void propagateDebugLocations(Module& wasm) {
95-
// Copy debug locations from parents to children that do not already have
96-
// their own debug locations.
95+
// Copy debug locations from parents or previous siblings to expressions that
96+
// do not already have their own debug locations.
9797
struct Propagator : WalkerPass<ExpressionStackWalker<Propagator>> {
9898
using Super = WalkerPass<ExpressionStackWalker<Propagator>>;
9999
bool isFunctionParallel() override { return true; }
@@ -112,11 +112,12 @@ void propagateDebugLocations(Module& wasm) {
112112

113113
static void doPreVisit(Propagator* self, Expression** currp) {
114114
Super::doPreVisit(self, currp);
115+
auto* curr = *currp;
115116
auto& locs = self->getFunction()->debugLocations;
116117
auto& parentDefaults = self->parentDefaults;
117-
if (auto it = locs.find(*currp); it != locs.end()) {
118+
if (auto it = locs.find(curr); it != locs.end()) {
118119
// Children will inherit this location.
119-
parentDefaults[*currp] = it->second;
120+
parentDefaults[curr] = it->second;
120121
if (auto* parent = self->getParent()) {
121122
// Subsequent siblings will inherit this location.
122123
parentDefaults[parent] = it->second;
@@ -127,7 +128,7 @@ void propagateDebugLocations(Module& wasm) {
127128
if (auto defaultIt = parentDefaults.find(parent);
128129
defaultIt != parentDefaults.end()) {
129130
// We have a default to inherit. Our children will inherit it, too.
130-
locs[*currp] = parentDefaults[*currp] = defaultIt->second;
131+
locs[curr] = parentDefaults[curr] = defaultIt->second;
131132
}
132133
}
133134
}

0 commit comments

Comments
 (0)