-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Fix infinite recursion when printing errors #85137
Conversation
The parsed language parameters contain unstripped spaces. This will generate a wrong path. Provide a `TOOLSOPT` to allow overriding the default values of parameters of the `make_rst.py` script. The xml generated by `godot --doctool -l LANG` can be checked for errors using `make xml-check LANGARG=LANG`, which may be useful for checking errors in po files.
update outdated link
Also add an explicit way to trigger the tool manually at user's will.
Co-authored-by: A Thousand Ships <[email protected]>
Co-authored-by: A Thousand Ships <[email protected]>
core/object/message_queue.cpp
Outdated
@@ -93,7 +95,7 @@ Error CallQueue::push_callablep(const Callable &p_callable, const Variant **p_ar | |||
|
|||
if ((page_bytes[pages_used - 1] + room_needed) > uint32_t(PAGE_SIZE_BYTES)) { | |||
if (pages_used == max_pages) { | |||
ERR_PRINT("Failed method: " + p_callable + ". Message queue out of memory. " + error_text); | |||
printf((const char*)("Failed method: " + p_callable + ". Message queue out of memory. " + error_text).get_data()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this cast isn't valid, it casts const char32_t *
to const char *
, I think it should be:
printf((const char*)("Failed method: " + p_callable + ". Message queue out of memory. " + error_text).get_data()); | |
printf((const char*)("Failed method: " + p_callable + ". Message queue out of memory. " + error_text).utf8()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Passing dynamic value to the printf
will cause warnings with some compilers (it's not safe since string can contain %*
), use something like:
printf("%s\n", ("Failed method: " + p_callable + ". Message queue out of memory. " + error_text).utf8().get_data());
or
printf("Failed method: %s. Message queue out of memory. %s\n", String(p_callable).utf8().get_data(), error_text.utf8().get_data());
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That does seem a better approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this cast isn't valid, it casts const char32_t * to const char *, I think it should be:
It's .utf8().get_data()
not just .utf8()
(which returns CharString
object).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's what the cast was for 🙂, it has:
operator const char *() const { return get_data(); };
But using get_data
is more clear, but was just tweaking the existing code
You need to use If you need help I can take this over, since all the added code has been instructed by others |
Yep it seems like you need to take this over. Somehow issues on my end. |
Superseded by: Thank you for your contribution nonetheless |
FIxes a tilemap bug in godot #84892.
Fixes as well an a potential infinite loop caused by repeating messages.