-
Notifications
You must be signed in to change notification settings - Fork 173
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
goalc: Confusion on return type when a sub-type is returned #772
Comments
yeah this is definitely a bug, I've noticed it too. We either need to make the compiler accept this, or have the decompiler be more strict at inserting casts on the return value. I don't want to make the compiler accept these. It would work in this case, but this same problem could happen with a The return type code is ancient (git says I last touched this 7 months ago!) so it's probably worth another pass to clean it up. At a first glance, it looks like we use a typecheck to see if we need to cast the return value, when we should really be checking if the types are exactly the same: A similar issue is true in the I'll take a closer look tomorrow, but this seems like it will be a quick fix. |
* add IR syntax highlighting * set the filterFileRegex properly! * stash * decompiler: Add print if conditional fails * decomp: Mostly finish `target-util` * decomp: figured out a bit more with `target-util`, a bit stuck now * decomp: *deep breath* `logic-target` mostly complete * decompiler: More robust arg_count checking for `format` calls * decomp: some more work in `target-util` * fix sllv usage * decomp: `logic-target` is compiling * decomp: `target-util` very close - blocked by decomp issue! * decomp: finish `target-util` except for one issue #772 * demp: update goal_src * linting * add back the one remaining method * address feedback, update source files
Take this example in target-util:
When compiled this results in the following:
control-info
is a sub-type ofcollide-shape
so this should not be an issue however.Sometimes this can be casted around, however in this case where it is accessing a field as the final arg, there doesn't seem to be a way to make the cast stick.
The text was updated successfully, but these errors were encountered: