forked from OSchip/llvm-project
COFF: ensure that we handle bad arguments
The parameter to /debugtype is user provided and may be invalid. Ensure that we gracefully handle bad input. llvm-svn: 294280
This commit is contained in:
parent
0acd6dd6ce
commit
b6394287e2
|
@ -406,7 +406,8 @@ static unsigned parseDebugType(StringRef Arg) {
|
||||||
DebugTypes |= StringSwitch<unsigned>(Type.lower())
|
DebugTypes |= StringSwitch<unsigned>(Type.lower())
|
||||||
.Case("cv", static_cast<unsigned>(DebugType::CV))
|
.Case("cv", static_cast<unsigned>(DebugType::CV))
|
||||||
.Case("pdata", static_cast<unsigned>(DebugType::PData))
|
.Case("pdata", static_cast<unsigned>(DebugType::PData))
|
||||||
.Case("fixup", static_cast<unsigned>(DebugType::Fixup));
|
.Case("fixup", static_cast<unsigned>(DebugType::Fixup))
|
||||||
|
.Default(0);
|
||||||
return DebugTypes;
|
return DebugTypes;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
# RUN: yaml2obj < %p/Inputs/pdb1.yaml > %t1.obj
|
||||||
|
# RUN: yaml2obj < %p/Inputs/pdb2.yaml > %t2.obj
|
||||||
|
# RUN: lld-link /debug /debugtype:invalid /pdb:%t.pdb /dll /out:%t.dll /entry:main /nodefaultlib \
|
||||||
|
# RUN: /debugpdb %t1.obj %t2.obj
|
||||||
|
|
Loading…
Reference in New Issue