HaxeFoundation / HaxeFoundation/hxcpp

Invalid file name causes "Allocating from a GC-free thread" error

Open
#1,048 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
330
Forks
227
Avg merge
2d 16h
Merged PRs (30d)
18

Description

When passing an invalid unicode string to `_hx_std_file_contents_string`, instead of giving the `Invalid UTF16` error, it gives `Critical Error: Allocating from a GC-free thread`.

This is because the exception is thrown by `utf8_str()` after `hx::EnterGCFreeZone()` is called, so allocating the exception results in the critical error:
https://github.com/HaxeFoundation/hxcpp/blob/86274fdbd8928b1a0872b7a809aa0b98525ae8d3/src/hx/libs/std/File.cpp#L301-L312

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.