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

Compiler allows tail calls to functions with aliased arguments #320

Closed
catamorphism opened this issue Apr 8, 2011 · 1 comment
Closed
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

Comments

@catamorphism
Copy link
Contributor

It seems to me that the following code:

 fn bar(&int i) -> bool {
   ret (i == 37);
  }

  fn foo(int i) -> bool {
    be bar(i);
  }

  fn main() {
    check(foo(37));
  }

should be rejected by the compiler, because foo makes a tail call to bar, whose argument is aliased. The check in the main function fails when I run this program, because bar gets garbage as its argument. The check succeeds if I change "be" to "ret" (reassuringly).

This is all with rustboot.

@marijnh
Copy link
Contributor

marijnh commented Jun 15, 2011

Fixed in 9b5ebe7

@marijnh marijnh closed this as completed Jun 15, 2011
arielb1 pushed a commit to arielb1/rust that referenced this issue Apr 10, 2015
oli-obk added a commit to oli-obk/rust that referenced this issue Sep 19, 2017
some more things found in the rustc test suite
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
kazcw pushed a commit to kazcw/rust that referenced this issue Oct 23, 2018
* added pclmul

* added docs

* pclmul -> pclmulqdq

* imm8: u8 -> imm8: i32

* return changes to stdsimd/arch/detect/x86.rs

* error fixes

* added rustc_args_required_const

* fixed assert_instr for _mm_clmulepi64_si128

* fixed pclmul assert_instr tests
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
* rename CreateDual to CreateForwardDiff

* add clearFunctionAttributes
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Fix codegen local for Fn::call and FnMut::call_mut

* Review comments

* Whitesapce

* Typo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.
Projects
None yet
Development

No branches or pull requests

2 participants