Skip to content
Commit 00d6f4bd authored by George Rimar's avatar George Rimar
Browse files

[LLD][ELF] - Fix crash when using empty --defsym.

We have a crash issue when handling the empty -defsym.

For parsing this option we are using ScriptParser class which is used
generally for reading the linker script. For empty defsym case, we
pass the empty memory buffer and crash in the place removed in https://reviews.llvm.org/rL336436.

But reverting of the above patch would not help here (we would still crash but a bit later). And
even after fixing the crash we would report something like
"lld.exe: error: -defsym:1: unexpected EOF"
It is probably not the appropriate message because mentions EOF.

I think the issue should be handled on a higher level like this patch does.
So we do not want to pass the empty memory buffer first of all I believe.

Differential revision: https://reviews.llvm.org/D50498

llvm-svn: 339412
parent ff08c80e
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment