[PATCH] D43399: [WebAssembly] Fix bug is function signature checking
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 11:27:00 PST 2018
sbc100 added inline comments.
================
Comment at: wasm/Symbols.h:97
- bool hasFunctionType() const { return FunctionType != nullptr; }
+ bool hasFunctionType() const { return Chunk || FunctionType; }
const WasmSignature &getFunctionType() const;
----------------
ruiu wrote:
> This class have setFunctionType and getFunctionType, but this variance doesn't seem to be guaranteed
>
> Obj.setFunctionType(X);
> assert(X == Obj.getFunctionType());
>
> because a value given to setFunctionType is ignored if this class have a non-null Chunk. Isn't that confusing?
`setFunctionType` has an `assert(!Chunk)` which i think covers that case.
Repository:
rLLD LLVM Linker
https://reviews.llvm.org/D43399
More information about the llvm-commits
mailing list