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

Shift binops appear to mutate their right operand. #152

Closed
froystig opened this issue Aug 26, 2010 · 1 comment
Closed

Shift binops appear to mutate their right operand. #152

froystig opened this issue Aug 26, 2010 · 1 comment

Comments

@froystig
Copy link
Contributor

The following program:

fn main() {
  let uint b = 1u;
  while (b <= 32u) {
    0u << b;
    b <<= 1u;
    log b;
  }
}

Gives the following output:

rt: 8d08:main:main:                       rust: 2 (0x2)
rt: 8d08:main:main:                       rust: 8 (0x8)
rt: 8d08:main:main:                       rust: 2048 (0x800)

The shift-left 0u << b is necessary to make this happen, but 0u >> b and 0u >>> b suffice to reproduce the bug just as well. Also, changing b <<= 1u to b = b << 1u makes the bug go away.

@graydon
Copy link
Contributor

graydon commented Aug 26, 2010

Make vreg constrs per-quad, regfence on nontrivial constrs, back out workaround to _uint, add regression test. Closed by 7cfa7bd.

mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
mbrubeck pushed a commit to mbrubeck/rust that referenced this issue Oct 17, 2011
oli-obk pushed a commit to oli-obk/rust that referenced this issue Jul 19, 2017
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 1, 2021
…ecked

Feature/const eval checked
Adds the const_evaluatable_checked cargo feature for some experimental (but very useful) function implementations. Adds testing all cargo features to CI.
djtech-dev pushed a commit to djtech-dev/rust that referenced this issue Dec 9, 2021
antoyo added a commit to antoyo/rust that referenced this issue Jun 7, 2022
Generate all listed architectures from llvmint
This issue was closed.
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

2 participants