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

Properly handle goto blocks #38

Open
chirsz-ever opened this issue Sep 12, 2019 · 6 comments
Open

Properly handle goto blocks #38

chirsz-ever opened this issue Sep 12, 2019 · 6 comments
Labels
good first issue Good for newcomers

Comments

@chirsz-ever
Copy link

I found a lot of rust code like that:
image
It should be replaced by some code without the match middle layer.

@crlf0710 crlf0710 changed the title Remove extra match expression Properly handle goto blocks Sep 12, 2019
@crlf0710
Copy link
Owner

crlf0710 commented Sep 12, 2019

These magic numbers are generated by the c2rust tool. The number represent a "control flow block" which may be a goto destination in the original program. This definitely needs to be improved, but we need a good solution.

@mulimoen
Copy link
Collaborator

mulimoen commented Oct 8, 2019

See also #140 for replacing a cleanup/panic goto with a function call

@mulimoen mulimoen added the good first issue Good for newcomers label Oct 8, 2019
@burrbull
Copy link
Collaborator

burrbull commented Oct 8, 2019

@mulimoen can you take a look at xetex_xetex0::read_font_info?

@mulimoen
Copy link
Collaborator

mulimoen commented Oct 8, 2019

Should be fairly straight forward by using a function bad_ftm() and done() at the end, and calling

return bad_ftm();

where

goto bad_ftm;

appears in the original source

@burrbull
Copy link
Collaborator

burrbull commented Nov 20, 2019

Functions still contain such current_blocks:

PR/Status File Function
xetex_aatfont loadAATfont
xetex_xetex0 main_control
xetex_linebreak try_break
hyphenate
bibtex.rs x_change_case
x_format_name
get_bib_command_or_entry_and_process
xetex_ext loadOTfont
dpx_pdfobj parse_xref_stream
read_xref

@chirsz-ever
Copy link
Author

Functions still contains current_blocks:

Some of the functions are still being rewote in progress, the removal of current_block would disturb other's work. They could be solved in other works conveniently instead of seperated PRs.

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

No branches or pull requests

4 participants