Skip to content

Commit 8add25a

Browse files
committed
Misc spot fixes
- Ensure QuotedString prints characters as `char` and not as an integer-like `unsigned char` - Assert when trying to add a null child node to a Demangle::Node
1 parent 263bbbb commit 8add25a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

lib/Basic/QuotedString.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ void swift::printAsQuotedString(llvm::raw_ostream &out, llvm::StringRef text) {
3636
};
3737
out << "\\u{" << hexdigit[c >> 4] << hexdigit[c & 0xF] << '}';
3838
} else {
39-
out << c;
39+
out << (char)c;
4040
}
4141
break;
4242
}

lib/Demangling/Demangler.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,7 @@ Node::iterator Node::end() const {
317317
}
318318

319319
void Node::addChild(NodePointer Child, NodeFactory &Factory) {
320+
assert(Child);
320321
switch (NodePayloadKind) {
321322
case PayloadKind::None:
322323
InlineChildren[0] = Child;

0 commit comments

Comments
 (0)