Description
WithRuntimeDecorator::createArrayBuffer delegates to the wrapped runtime without constructing Around around{with_}. Adjacent methods construct that guard before delegation.
This bypasses the supplied guard's before/after policy during allocation and exception unwinding. Inspected in React Native 0.86.3, 0.87.1 and main 3818b20eed.
Reproduction
A wrapped allocator records the guard depth while creating an ArrayBuffer. Stock code sees depth 0 and invokes neither callback. With the RAII scope, allocation runs at depth 1 and callbacks balance on both return and throw.
Two focused native GTests fail on stock sources and pass with the scope added. They also check supplied buffer size/data. This demonstrates the guard omission; it does not attribute other Hermes crashes to it.
Native regression source: https://github.com/JoaoPauloCMarra/react-native/blob/a26ab901b9/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp
Description
WithRuntimeDecorator::createArrayBufferdelegates to the wrapped runtime without constructingAround around{with_}. Adjacent methods construct that guard before delegation.This bypasses the supplied guard's
before/afterpolicy during allocation and exception unwinding. Inspected in React Native 0.86.3, 0.87.1 and main3818b20eed.Reproduction
A wrapped allocator records the guard depth while creating an ArrayBuffer. Stock code sees depth 0 and invokes neither callback. With the RAII scope, allocation runs at depth 1 and callbacks balance on both return and throw.
Two focused native GTests fail on stock sources and pass with the scope added. They also check supplied buffer size/data. This demonstrates the guard omission; it does not attribute other Hermes crashes to it.
Native regression source: https://github.com/JoaoPauloCMarra/react-native/blob/a26ab901b9/packages/react-native/ReactCommon/jsi/jsi/test/testlib.cpp