-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
CFI: Append debug location to CFI blocks #132702
Conversation
Some changes occurred in tests/codegen/sanitizer cc @rust-lang/project-exploit-mitigations, @rcvalle Some changes occurred in compiler/rustc_codegen_gcc |
r? @rcvalle |
Thank you for your time and for working on this, @1c3t3a ! Much appreciated. Alternatively, this could be implemented by passing back/returning the blocks created by CFI to rustc_codegen_ssa if any, but I'm OK with this implementation. I think invoke and call need some refactoring (and possibly being consolidated into one) anyway, and from past conversations with @bjorn3 seemed to agree, and might be interested in providing feedback here. Otherwise; LGTM (FYI @cuviper). |
Another alternative would be to get the current debug information before appending the CFI blocks, remember it and append it to all inserted blocks. This would need to call LLVMGetCurrentDebugLocation2, which is currently not used by rustc. It would have the benefit that it doesn't need to change |
I think that would be preferred if you don't mind. You can add |
9ea79fe
to
b5e4f5a
Compare
Oke great! I updated the implementation accordingly :) |
@bors r+ |
…iaskrgr Rollup of 7 pull requests Successful merges: - rust-lang#132702 (CFI: Append debug location to CFI blocks) - rust-lang#132851 (Update the doc comment of `ASCII_CASE_MASK`) - rust-lang#132948 (stabilize const_unicode_case_lookup) - rust-lang#132950 (Use GNU ld on m68k-unknown-linux-gnu) - rust-lang#132962 (triagebot: add codegen reviewers) - rust-lang#132966 (stabilize const_option_ext) - rust-lang#132970 (Add tracking issue number to unsigned_nonzero_div_ceil feature) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#132702 - 1c3t3a:issue-132615, r=rcvalle CFI: Append debug location to CFI blocks Currently we're not appending debug locations to the inserted CFI blocks. This shows up in rust-lang#132615 and rust-lang#100783. This change fixes that by passing down the debug location to the CFI type-test generation and appending it to the blocks. Credits also belong to `@jakos-sec` who worked with me on this.
Currently we're not appending debug locations to the inserted CFI blocks. This shows up in #132615 and #100783. This change fixes that by passing down the debug location to the CFI type-test generation and appending it to the blocks.
Credits also belong to @jakos-sec who worked with me on this.