Closed
Description
Version
16.13.2
Platform
Microsoft Windows NT 10.0.19042.0 x64
Subsystem
No response
What steps will reproduce the bug?
In file node_buffer.cc
, macro THROW_AND_RETURN_IF_OOB
is called with a function as argument :
THROW_AND_RETURN_IF_OOB(ParseArrayIndex(env, args[0], 0, &start));
This macro is replaced with this code :
do { \
if ((ParseArrayIndex(env, args[0], 0, &start)).IsNothing()) return; \
if (!(ParseArrayIndex(env, args[0], 0, &start)).FromJust()) \
return node::THROW_ERR_OUT_OF_RANGE(env, "Index out of range"); \
} while (0)
The ParseArrayIndex
function will be called twice which will generate performance losses.
How often does it reproduce? Is there a required condition?
No response
What is the expected behavior?
No response
What do you see instead?
Each macro call of THROW_AND_RETURN_IF_OOB
macro should be checked.
Additional information
No response