fix index out of bounds error of x86_64 ABI

This commit is contained in:
Jyun-Yan You 2013-04-08 21:21:11 +08:00 committed by Jyun-Yan You
parent 65ff441b3d
commit 4ad8ec351a
2 changed files with 21 additions and 2 deletions

View File

@ -256,10 +256,10 @@ fn classify_ty(ty: TypeRef) -> ~[x86_64_reg_class] {
cls[i] = sse_int_class;
} else if is_sse(cls[i]) {
i += 1;
while cls[i] == sseup_class { i += 1u; }
while i != e && cls[i] == sseup_class { i += 1u; }
} else if cls[i] == x87_class {
i += 1;
while cls[i] == x87up_class { i += 1u; }
while i != e && cls[i] == x87up_class { i += 1u; }
} else {
i += 1;
}

View File

@ -0,0 +1,19 @@
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
struct S {
r: float
}
extern "C" {
fn rust_dbg_extern_identity_double(arg1: S) -> float;
}
pub fn main() {}