Skip to content

Commit

Permalink
demangler: fix a crash when trying to demangle a non-swift symbol
Browse files Browse the repository at this point in the history
rdar://problem/30982254
  • Loading branch information
eeckstein committed Mar 10, 2017
1 parent e463e69 commit aa8cc0a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/Demangling/Demangler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,8 @@ NodePointer Demangler::demangleIdentifier() {

NodePointer Demangler::demangleOperatorIdentifier() {
NodePointer Ident = popNode(Node::Kind::Identifier);
if (!Ident)
return nullptr;

static const char op_char_table[] = "& @/= > <*!|+?%-~ ^ .";

Expand Down
1 change: 1 addition & 0 deletions test/Demangle/Inputs/manglings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -244,4 +244,5 @@ _T0s17MutableCollectionP1asAARzs012RandomAccessB0RzsAA11SubSequences013Bidirecti
_T03foo4_123ABTf3psbpsb_n ---> function signature specialization <Arg[0] = [Constant Propagated String : u8'123'], Arg[1] = [Constant Propagated String : u8'123']> of foo
_T04main5innerys5Int32Vz_yADctF25closure_with_box_argumentxz_Bi32__lXXTf1nc_n ---> function signature specialization <Arg[1] = [Closure Propagated : closure_with_box_argument, Argument Types : [<A> { var A } <Builtin.Int32>]> of main.inner (inout Swift.Int32, (Swift.Int32) -> ()) -> ()
_T03foo6testityyyc_yyctF1a1bTf3pfpf_n ---> function signature specialization <Arg[0] = [Constant Propagated Function : a], Arg[1] = [Constant Propagated Function : b]> of foo.testit (() -> (), () -> ()) -> ()
_SocketJoinOrLeaveMulticast ---> _SocketJoinOrLeaveMulticast

0 comments on commit aa8cc0a

Please sign in to comment.