We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2205fb3 commit 8358ba0Copy full SHA for 8358ba0
lib/evmone/baseline.cpp
@@ -53,8 +53,7 @@ std::unique_ptr<uint8_t[]> pad_code(bytes_view code)
53
// instruction at the code end.
54
constexpr auto padding = 32 + 1;
55
56
- // Using "raw" new operator instead of std::make_unique() to get uninitialized array.
57
- std::unique_ptr<uint8_t[]> padded_code{new uint8_t[code.size() + padding]};
+ auto padded_code = std::make_unique_for_overwrite<uint8_t[]>(code.size() + padding);
58
std::copy(std::begin(code), std::end(code), padded_code.get());
59
std::fill_n(&padded_code[code.size()], padding, uint8_t{OP_STOP});
60
return padded_code;
0 commit comments