response for review comments
This commit is contained in:
parent
1ee345a87b
commit
61ab2ea08a
|
@ -720,12 +720,12 @@ impl<'b, 'tcx> CrateContext<'b, 'tcx> {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn max_obj_size(&self) -> u64 {
|
pub fn max_obj_size(&self) -> u64 {
|
||||||
1<<31 /* FIXME: select based on architecture */
|
1<<31 /* FIXME #18069: select based on architecture */
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn report_overbig_object(&self, obj: ty::t) -> ! {
|
pub fn report_overbig_object(&self, obj: ty::t) -> ! {
|
||||||
self.sess().fatal(
|
self.sess().fatal(
|
||||||
format!("Objects of type `{}` are too big for the current ABI",
|
format!("the type `{}` is too big for the current architecture",
|
||||||
obj.repr(self.tcx())).as_slice())
|
obj.repr(self.tcx())).as_slice())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -499,7 +499,7 @@ pub fn trans_fail<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||||
let loc = bcx.sess().codemap().lookup_char_pos(sp.lo);
|
let loc = bcx.sess().codemap().lookup_char_pos(sp.lo);
|
||||||
let filename = token::intern_and_get_ident(loc.file.name.as_slice());
|
let filename = token::intern_and_get_ident(loc.file.name.as_slice());
|
||||||
let filename = C_str_slice(ccx, filename);
|
let filename = C_str_slice(ccx, filename);
|
||||||
let line = C_int(ccx, loc.line as i64);
|
let line = C_uint(ccx, loc.line);
|
||||||
let expr_file_line_const = C_struct(ccx, &[v_str, filename, line], false);
|
let expr_file_line_const = C_struct(ccx, &[v_str, filename, line], false);
|
||||||
let expr_file_line = consts::const_addr_of(ccx, expr_file_line_const, ast::MutImmutable);
|
let expr_file_line = consts::const_addr_of(ccx, expr_file_line_const, ast::MutImmutable);
|
||||||
let args = vec!(expr_file_line);
|
let args = vec!(expr_file_line);
|
||||||
|
@ -526,7 +526,7 @@ pub fn trans_fail_bounds_check<'blk, 'tcx>(bcx: Block<'blk, 'tcx>,
|
||||||
|
|
||||||
// Invoke the lang item
|
// Invoke the lang item
|
||||||
let filename = C_str_slice(ccx, filename);
|
let filename = C_str_slice(ccx, filename);
|
||||||
let line = C_int(ccx, loc.line as i64);
|
let line = C_uint(ccx, loc.line);
|
||||||
let file_line_const = C_struct(ccx, &[filename, line], false);
|
let file_line_const = C_struct(ccx, &[filename, line], false);
|
||||||
let file_line = consts::const_addr_of(ccx, file_line_const, ast::MutImmutable);
|
let file_line = consts::const_addr_of(ccx, file_line_const, ast::MutImmutable);
|
||||||
let args = vec!(file_line, index, len);
|
let args = vec!(file_line, index, len);
|
||||||
|
|
|
@ -28,9 +28,9 @@ use std::num::CheckedMul;
|
||||||
|
|
||||||
// LLVM doesn't like objects that are too big. Issue #17913
|
// LLVM doesn't like objects that are too big. Issue #17913
|
||||||
fn ensure_array_fits_in_address_space(ccx: &CrateContext,
|
fn ensure_array_fits_in_address_space(ccx: &CrateContext,
|
||||||
llet: Type,
|
llet: Type,
|
||||||
size: machine::llsize,
|
size: machine::llsize,
|
||||||
scapegoat: ty::t) {
|
scapegoat: ty::t) {
|
||||||
let esz = machine::llsize_of_alloc(ccx, llet);
|
let esz = machine::llsize_of_alloc(ccx, llet);
|
||||||
match esz.checked_mul(&size) {
|
match esz.checked_mul(&size) {
|
||||||
Some(n) if n < ccx.max_obj_size() => {}
|
Some(n) if n < ccx.max_obj_size() => {}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: too big for the current ABI
|
// error-pattern: too big for the current
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
let fat : [u8, ..1<<61] = [0, ..1<<61];
|
let fat : [u8, ..1<<61] = [0, ..1<<61];
|
|
@ -8,7 +8,7 @@
|
||||||
// option. This file may not be copied, modified, or distributed
|
// option. This file may not be copied, modified, or distributed
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
// error-pattern: are too big for the current ABI
|
// error-pattern: too big for the current
|
||||||
|
|
||||||
struct S32<T> {
|
struct S32<T> {
|
||||||
v0: T,
|
v0: T,
|
Loading…
Reference in New Issue