@@ -263,23 +263,23 @@ namespace eth {
263263 evmcResult.output_data = result.output .data ();
264264 evmcResult.output_size = result.output .size ();
265265
266- #ifdef DEBUG
267- if (evmcResult.output_size ) {
268- // fix an issue that Stack around the variable 'result' was corrupted
269- evmc_get_optional_storage (&evmcResult)->pointer = std::malloc (evmcResult.output_size );
270- new (evmc_get_optional_storage (&evmcResult)->pointer ) bytes (result.output .takeBytes ());
271-
272- evmcResult.release = [](evmc_result const * _result)
273- {
274- uint8_t * data = (uint8_t *)evmc_get_const_optional_storage (_result)->pointer ;
275- auto & output = reinterpret_cast <bytes const &>(*data);
276- // Explicitly call vector's destructor to release its data.
277- // This is normal pattern when placement new operator is used.
278- output.~bytes ();
279- std::free (data);
280- };
281- }
282- #else
266+ // #ifdef DEBUG
267+ // if (evmcResult.output_size) {
268+ // // fix an issue that Stack around the variable 'result' was corrupted
269+ // evmc_get_optional_storage(&evmcResult)->pointer = std::malloc(evmcResult.output_size);
270+ // new(evmc_get_optional_storage(&evmcResult)->pointer) bytes(result.output.takeBytes());
271+ //
272+ // evmcResult.release = [](evmc_result const* _result)
273+ // {
274+ // uint8_t* data = (uint8_t*)evmc_get_const_optional_storage(_result)->pointer;
275+ // auto& output = reinterpret_cast<bytes const&>(*data);
276+ // // Explicitly call vector's destructor to release its data.
277+ // // This is normal pattern when placement new operator is used.
278+ // output.~bytes();
279+ // std::free(data);
280+ // };
281+ // }
282+ // #else
283283 // Place a new vector of bytes containing output in result's reserved memory.
284284 auto * data = evmc_get_optional_storage (&evmcResult);
285285 // static_assert(sizeof(bytes) <= sizeof(*data), "Vector is too big");
@@ -294,7 +294,7 @@ namespace eth {
294294 // This is normal pattern when placement new operator is used.
295295 output.~bytes ();
296296 };
297- #endif
297+ // #endif
298298 return evmc::result{ evmcResult };
299299 }
300300
0 commit comments