Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Infinite recursion in NewArrayBufferWithContents #526

Open
jschwe opened this issue Nov 22, 2024 · 1 comment
Open

Infinite recursion in NewArrayBufferWithContents #526

jschwe opened this issue Nov 22, 2024 · 1 comment

Comments

@jschwe
Copy link
Member

jschwe commented Nov 22, 2024

warning: [email protected]: src/jsapi.cpp: In function ‘JSObject* glue::NewArrayBufferWithContents(JSContext*, size_t, void*)’:
warning: [email protected]: src/jsapi.cpp:158:11: warning: infinite recursion detected [-Winfinite-recursion]
warning: [email protected]:   158 | JSObject* NewArrayBufferWithContents(JSContext* cx, size_t nbytes,
warning: [email protected]:       |           ^~~~~~~~~~~~~~~~~~~~~~~~~~
warning: [email protected]: src/jsapi.cpp:161:36: note: recursive call
warning: [email protected]:   161 |   return NewArrayBufferWithContents(cx, nbytes, contents);
warning: [email protected]:       |          ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~

JSObject* NewArrayBufferWithContents(JSContext* cx, size_t nbytes,
void* contents) {
js::UniquePtr<void, JS::FreePolicy> dataPtr{contents};
return NewArrayBufferWithContents(cx, nbytes, contents);

@sagudev
Copy link
Member

sagudev commented Nov 22, 2024

I think the problem is that we should actually call JS::NewArrayBufferWithContents from JS namespace. I was sure I already fixed this, but I guess not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants