Fixed arg_formatter_base::write_pointer to not mutate the format specs.

This fixes cases where arg_formatters are reused, like with arg_join.
This commit is contained in:
Michael Winterberg
2018-04-30 11:09:40 -07:00
committed by Victor Zverovich
parent 6cd666100f
commit ca31ca13f1
2 changed files with 8 additions and 3 deletions

View File

@@ -1431,9 +1431,10 @@ class arg_formatter_base {
}
void write_pointer(const void *p) {
specs_.flags_ = HASH_FLAG;
specs_.type_ = 'x';
writer_.write_int(reinterpret_cast<uintptr_t>(p), specs_);
format_specs specs = specs_;
specs.flags_ = HASH_FLAG;
specs.type_ = 'x';
writer_.write_int(reinterpret_cast<uintptr_t>(p), specs);
}
protected: