Skip to content

Commit f15c2a7

Browse files
authored
Merge pull request #38429 from al45tair/problem/80602920
[Demangler] Fix NULL dereference on malformed mangled class name.
2 parents 95be0d6 + c23d2f4 commit f15c2a7

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/Demangling/Demangler.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2639,7 +2639,8 @@ NodePointer Demangler::demangleAutoDiffSelfReorderingReabstractionThunk() {
26392639
addChild(result, popNode(Node::Kind::DependentGenericSignature));
26402640
result = addChild(result, popNode(Node::Kind::Type));
26412641
result = addChild(result, popNode(Node::Kind::Type));
2642-
result->reverseChildren();
2642+
if (result)
2643+
result->reverseChildren();
26432644
result = addChild(result, demangleAutoDiffFunctionKind());
26442645
return result;
26452646
}

test/Demangle/Inputs/manglings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,3 +414,4 @@ $s4test10returnsOptyxycSgxyScMYccSglF ---> test.returnsOpt<A>((@Swift.MainActor
414414
$s1t10globalFuncyyAA7MyActorCYiF ---> t.globalFunc(isolated t.MyActor) -> ()
415415
$sSIxip6foobarP ---> foobar in Swift.DefaultIndices.subscript : A
416416
$s13__lldb_expr_110$10016c2d8yXZ1B10$10016c2e0LLC ---> __lldb_expr_1.(unknown context at $10016c2d8).(B in $10016c2e0)
417+
$s__TJO ---> $s__TJO

0 commit comments

Comments
 (0)