Skip to content

Commit

Permalink
bugfix for empty typedarray
Browse files Browse the repository at this point in the history
Pointer.equalsptr
  • Loading branch information
karikera committed Apr 12, 2022
1 parent f61f6c6 commit 4348455
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion bdsx/nativepointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ void NativePointer::writeBuffer(JsValue buffer) throws(JsException)
try
{
Buffer buf = buffer.getBuffer();
if (buf == nullptr) throw JsException(u"argument must be buffer");
if (buf == nullptr) return;
size_t size = buf.size();
memcpy(m_address, buf.data(), size);
m_address += size;
Expand Down
2 changes: 1 addition & 1 deletion bdsx/staticpointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ void StaticPointer::setBuffer(JsValue buffer, int offset) throws(JsException)
try
{
Buffer buf = buffer.getBuffer();
if (buf == nullptr) throw JsException(u"argument must be buffer");
if (buf == nullptr) return;
size_t size = buf.size();
memcpy(p, buf.data(), size);
}
Expand Down
2 changes: 1 addition & 1 deletion bdsx/version.bat
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@

set BDSX_CORE_VERSION=1.0.12.1
set BDSX_CORE_VERSION=1.0.12.2
1 change: 1 addition & 0 deletions bdsx/voidpointer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ void VoidPointer::initMethods(JsClassT<VoidPointer>* cls) noexcept
cls->setMethod(u"addressOfThis", &VoidPointer::addressOfThis);

cls->setMethod(u"equals", &VoidPointer::equals);
cls->setMethod(u"equalsptr", &VoidPointer::equals);
cls->setMethod(u"add", &VoidPointer::add);
cls->setMethod(u"sub", &VoidPointer::sub);
cls->setMethod(u"addBin", &VoidPointer::addBin);
Expand Down

0 comments on commit 4348455

Please sign in to comment.