Commit 76fa3006 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[wasm] Remove dangerous {WasmCompiledModule} accessors.

Note that {nullptr} is a dangerous sentinel value in V8's object model
because it can be interpreted as Smi(0) and hence will turn into a
completely different type than the declared return type at runtime.

R=ahaas@chromium.org
BUG=v8:7509

Change-Id: I89cffa1160a3bf6853f91c04fb90c74ad08888a3
Reviewed-on: https://chromium-review.googlesource.com/948907Reviewed-by: 's avatarClemens Hammacher <clemensh@chromium.org>
Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#51757}
parent 33be2fb1
......@@ -94,12 +94,6 @@ OPTIONAL_ACCESSORS(WasmDebugInfo, c_wasm_entry_map, Managed<wasm::SignatureMap>,
#undef OPTIONAL_ACCESSORS
#define WCM_OBJECT_OR_WEAK(TYPE, NAME, OFFSET, TYPE_CHECK) \
TYPE* WasmCompiledModule::maybe_##NAME() const { \
Object* value = READ_FIELD(this, OFFSET); \
if (!(TYPE_CHECK)) return nullptr; \
return TYPE::cast(value); \
} \
\
bool WasmCompiledModule::has_##NAME() const { \
Object* value = READ_FIELD(this, OFFSET); \
return TYPE_CHECK; \
......
......@@ -453,7 +453,6 @@ class WasmCompiledModule : public Struct {
#define WCM_OBJECT_OR_WEAK(TYPE, NAME, SETTER_MODIFIER) \
public: \
inline TYPE* maybe_##NAME() const; \
inline TYPE* NAME() const; \
inline bool has_##NAME() const; \
inline void reset_##NAME(); \
......
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