Skip to content

Commit

Permalink
Export of internal Abseil changes
Browse files Browse the repository at this point in the history
--
1829e203300191671abd4b478ca189019e6f88b1 by Abseil Team <[email protected]>:

Don't return true from Demangle() when we didn't actually produce demangled output.

PiperOrigin-RevId: 332544020

--
239b617bd8322cfda69d0dcdd3d78499ed61206d by Abseil Team <[email protected]>:

Minor documentation fix.

PiperOrigin-RevId: 332517877

--
d566c156619bbdceaf6e84bd0d3aa575d5e790f8 by Gennadiy Rozental <[email protected]>:

Added missing asserts for seq.index() < capacity_ and unified their usage based on has_element().

Import of #781

PiperOrigin-RevId: 332229369
GitOrigin-RevId: 1829e203300191671abd4b478ca189019e6f88b1
Change-Id: I5bb1f713497fef54a7abaf2020be91cb32e87b93
  • Loading branch information
Abseil Team authored and rogeeff committed Sep 20, 2020
1 parent 20feb1c commit d3614de
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
4 changes: 3 additions & 1 deletion absl/container/internal/raw_hash_set.h
Original file line number Diff line number Diff line change
Expand Up @@ -1327,6 +1327,7 @@ class raw_hash_set {
}
if (ABSL_PREDICT_TRUE(g.MatchEmpty())) return end();
seq.next();
assert(seq.index() < capacity_ && "full table!");
}
}
template <class K = key_type>
Expand Down Expand Up @@ -1678,8 +1679,8 @@ class raw_hash_set {
#endif
return {seq.offset(mask.LowestBitSet()), seq.index()};
}
assert(seq.index() < capacity_ && "full table!");
seq.next();
assert(seq.index() < capacity_ && "full table!");
}
}

Expand Down Expand Up @@ -1710,6 +1711,7 @@ class raw_hash_set {
}
if (ABSL_PREDICT_TRUE(g.MatchEmpty())) break;
seq.next();
assert(seq.index() < capacity_ && "full table!");
}
return {prepare_insert(hash), true};
}
Expand Down
3 changes: 2 additions & 1 deletion absl/debugging/internal/demangle.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1936,7 +1936,8 @@ static bool Overflowed(const State *state) {
bool Demangle(const char *mangled, char *out, int out_size) {
State state;
InitState(&state, mangled, out, out_size);
return ParseTopLevelMangledName(&state) && !Overflowed(&state);
return ParseTopLevelMangledName(&state) && !Overflowed(&state) &&
state.parse_state.out_cur_idx > 0;
}

} // namespace debugging_internal
Expand Down
4 changes: 2 additions & 2 deletions absl/status/status.h
Original file line number Diff line number Diff line change
Expand Up @@ -365,8 +365,8 @@ class ABSL_MUST_USE_RESULT Status final {
// Constructors

// This default constructor creates an OK status with no message or payload.
// Avoid this constructor and pefer explicit construction of an OK status with
// `absl::OkStatus()`.
// Avoid this constructor and prefer explicit construction of an OK status
// with `absl::OkStatus()`.
Status();

// Creates a status in the canonical error space with the specified
Expand Down

0 comments on commit d3614de

Please sign in to comment.