[PATCH] D43399: [WebAssembly] Fix bug is function signature checking

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 16 11:19:24 PST 2018


ruiu 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;
----------------
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?


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D43399





More information about the llvm-commits mailing list