diff --git a/runtime/core/evalue.h b/runtime/core/evalue.h index c0c534e0692..d2e57c35d4d 100644 --- a/runtime/core/evalue.h +++ b/runtime/core/evalue.h @@ -248,7 +248,9 @@ struct EValue { decltype(*std::forward(value)), EValue>::value>::type* = 0) { ET_CHECK_MSG(value != nullptr, "Pointer is null."); - *this = EValue(*std::forward(value)); + // Note that this ctor does not initialize this->tag directly; it is set by + // moving in the new value. + moveFrom(*std::forward(value)); } // Delete constructor for raw pointers to ensure they cannot be used.