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

TS: segfault/crash with --gen-object-api for array of enums #8311

Open
jtbandes opened this issue May 17, 2024 · 0 comments
Open

TS: segfault/crash with --gen-object-api for array of enums #8311

jtbandes opened this issue May 17, 2024 · 0 comments

Comments

@jtbandes
Copy link

jtbandes commented May 17, 2024

The following schema triggers a segmentation fault:

enum Color : byte { Red = 1, Green, Blue }

struct MyStruct {
  xyz:[Color:1];
}
$ flatc --version
flatc version 24.3.25
$ flatc --ts --ts-no-import-ext --gen-object-api -o gen *.fbs
zsh: segmentation fault  flatc --ts --ts-no-import-ext --gen-object-api -o gen *.fbs

This seems to occur because 0 is not a valid value for Color. If you change Red = 1, to Red = 0, or just Red, then the crash no longer occurs.

If you remove the --gen-object-api the crash no longer occurs.

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

1 participant