Commit 946f2902 authored by Simon Pilgrim's avatar Simon Pilgrim
Browse files

[llvm-objdump] Use cast<> instead of dyn_cast<> to avoid dereference of nullptr

The pointer is dereferenced immediately, so assert the cast is correct instead of returning nullptr
parent 20d46fbd
...@@ -20,7 +20,7 @@ using namespace llvm; ...@@ -20,7 +20,7 @@ using namespace llvm;
using namespace llvm::object; using namespace llvm::object;
void objdump::printWasmFileHeader(const object::ObjectFile *Obj) { void objdump::printWasmFileHeader(const object::ObjectFile *Obj) {
const auto *File = dyn_cast<const WasmObjectFile>(Obj); const auto *File = cast<const WasmObjectFile>(Obj);
outs() << "Program Header:\n"; outs() << "Program Header:\n";
outs() << "Version: 0x"; outs() << "Version: 0x";
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment