Skip to content
This repository was archived by the owner on May 23, 2024. It is now read-only.

ices/62046.rs: fixed with errors #305

Merged
merged 1 commit into from
Mar 11, 2020
Merged

ices/62046.rs: fixed with errors #305

merged 1 commit into from
Mar 11, 2020

Conversation

github-actions[bot]
Copy link
Contributor

Issue: rust-lang/rust#62046

#![feature(asm)]

struct ThreadContext {
    rsp: u64,
    r15: u64,
}

fn gt_switch(new: *const ThreadContext) -> ! {
    unsafe {
        asm!("mov     $1, $0" : "+r"("r15") : "*m"(&(*new).r15));
        asm!("mov     $1, $0" : "+r"("rsp") : "*m"(&(*new).rsp));
        asm!("ret");
        std::hint::unreachable_unchecked()
    }
}

fn main() {
    let ctx = ThreadContext{rsp: 0x80, r15: 0x88};

    gt_switch(&ctx);
}
=== stdout ===
=== stderr ===
error[E0668]: malformed inline assembly
  --> /home/runner/work/glacier/glacier/ices/62046.rs:10:9
   |
10 |         asm!("mov     $1, $0" : "+r"("r15") : "*m"(&(*new).r15));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0668]: malformed inline assembly
  --> /home/runner/work/glacier/glacier/ices/62046.rs:11:9
   |
11 |         asm!("mov     $1, $0" : "+r"("rsp") : "*m"(&(*new).rsp));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0668`.
==============

=== stdout ===
=== stderr ===
error[E0668]: malformed inline assembly
  --> /home/runner/work/glacier/glacier/ices/62046.rs:10:9
   |
10 |         asm!("mov     $1, $0" : "+r"("r15") : "*m"(&(*new).r15));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error[E0668]: malformed inline assembly
  --> /home/runner/work/glacier/glacier/ices/62046.rs:11:9
   |
11 |         asm!("mov     $1, $0" : "+r"("rsp") : "*m"(&(*new).rsp));
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to 2 previous errors

For more information about this error, try `rustc --explain E0668`.
==============
@JohnTitor JohnTitor merged commit 671893c into master Mar 11, 2020
@JohnTitor JohnTitor deleted the autofix/ices/62046.rs branch March 11, 2020 12:15
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants