summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTobias Nießen <tniessen@users.noreply.github.com>2018-10-11 17:01:17 -0700
committerAnna Henningsen <anna@addaleax.net>2018-10-11 22:05:51 -0700
commit714c1b88d2d05d1c868ffdde1a827cd74d092e07 (patch)
tree47bd63c57a055ece6f8fd7ef2b99663cc166cf96
parentd3d6cd3ecad19602a894bbe046253ae924d278d4 (diff)
downloadandroid-node-v8-714c1b88d2d05d1c868ffdde1a827cd74d092e07.tar.gz
android-node-v8-714c1b88d2d05d1c868ffdde1a827cd74d092e07.tar.bz2
android-node-v8-714c1b88d2d05d1c868ffdde1a827cd74d092e07.zip
src: fix bug in MallocedBuffer constructor
This should be a generic type even though we are currently only using `char` as `T`. PR-URL: https://github.com/nodejs/node/pull/23434 Reviewed-By: Sakthipriyan Vairamani <thechargingvolcano@gmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Refael Ackermann <refack@gmail.com> Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com>
-rw-r--r--src/util.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/util.h b/src/util.h
index b522a88b72..d41255bd32 100644
--- a/src/util.h
+++ b/src/util.h
@@ -443,7 +443,7 @@ struct MallocedBuffer {
MallocedBuffer() : data(nullptr) {}
explicit MallocedBuffer(size_t size) : data(Malloc<T>(size)), size(size) {}
- MallocedBuffer(char* data, size_t size) : data(data), size(size) {}
+ MallocedBuffer(T* data, size_t size) : data(data), size(size) {}
MallocedBuffer(MallocedBuffer&& other) : data(other.data), size(other.size) {
other.data = nullptr;
}