@@ -37,6 +37,28 @@ fn find_rust_files(&files: [str], path: str) {
37
37
}
38
38
}
39
39
40
+
41
+ fn common_exprs ( ) -> [ ast:: expr ] {
42
+ fn dse ( e : ast:: expr_ ) -> ast:: expr {
43
+ { id: 0 , node: e, span: ast_util:: dummy_sp ( ) }
44
+ }
45
+
46
+ fn dsl ( l : ast:: lit_ ) -> ast:: lit {
47
+ { node: l, span: ast_util:: dummy_sp ( ) }
48
+ }
49
+
50
+ [ dse ( ast:: expr_break) ,
51
+ dse ( ast:: expr_cont) ,
52
+ dse ( ast:: expr_fail ( option:: none) ) ,
53
+ dse ( ast:: expr_fail ( option:: some ( @dse ( ast:: expr_lit ( @dsl ( ast:: lit_str ( "boo" ) ) ) ) ) ) ) ,
54
+ dse ( ast:: expr_ret ( option:: none) ) ,
55
+ dse ( ast:: expr_put ( option:: none) ) ,
56
+ dse ( ast:: expr_lit ( @dsl ( ast:: lit_nil) ) ) ,
57
+ dse ( ast:: expr_lit ( @dsl ( ast:: lit_bool ( false ) ) ) ) ,
58
+ dse ( ast:: expr_lit ( @dsl ( ast:: lit_bool ( true ) ) ) )
59
+ ]
60
+ }
61
+
40
62
fn safe_to_steal_expr( e : @ast:: expr ) -> bool {
41
63
alt e. node {
42
64
/*
@@ -189,7 +211,7 @@ fn as_str(f: fn(io::writer)) -> str {
189
211
fn check_variants_of_ast ( crate : ast:: crate , codemap : codemap:: codemap ,
190
212
filename : str ) {
191
213
let stolen = steal ( crate ) ;
192
- check_variants_T ( crate , codemap, filename, "expr" , stolen. exprs , pprust:: expr_to_str, replace_expr_in_crate) ;
214
+ check_variants_T ( crate , codemap, filename, "expr" , /*common_exprs() +*/ stolen. exprs , pprust:: expr_to_str, replace_expr_in_crate) ;
193
215
check_variants_T ( crate , codemap, filename, "ty" , stolen. tys , pprust:: ty_to_str, replace_ty_in_crate) ;
194
216
}
195
217
@@ -207,9 +229,9 @@ fn check_variants_T<T>(
207
229
let L = vec:: len ( things) ;
208
230
209
231
if L < 100 u {
210
- for each i: uint in under ( uint:: min ( L , 10 u ) ) {
211
- log_err "Replacing ... " + stringifier(@things[i] );
212
- for each j: uint in under(uint::min(L, 10u )) {
232
+ for each i: uint in under ( uint:: min ( L , 20 u ) ) {
233
+ log_err "Replacing... # " + uint :: str ( i ) ;
234
+ for each j: uint in under ( uint:: min ( L , 30 u ) ) {
213
235
log_err "With ... " + stringifier(@things[j]);
214
236
let crate2 = @replacer(crate, i, things[j]);
215
237
// It would be best to test the *crate* for stability, but testing the
@@ -283,8 +305,12 @@ fn check_running(exe_filename: str) -> happiness {
283
305
log_err "comb comb comb: " + comb;
284
306
}
285
307
286
- if contains ( comb, "Assertion failed:" ) {
308
+ if contains ( comb, "Assertion failed: (0), function alloc, file ../src/rt/rust_obstack.cpp" ) {
309
+ known_bug ( "https://github.com/graydon/rust/issues/32 / https://github.com/graydon/rust/issues/445" )
310
+ } else if contains ( comb, "Assertion failed:" ) {
287
311
failed ( "C++ assertion failure" )
312
+ } else if contains ( comb, "src/rt/" ) {
313
+ failed ( "Mentioned src/rt/" )
288
314
} else if contains ( comb, "malloc" ) {
289
315
failed ( "Mentioned malloc" )
290
316
} else if contains ( comb, "leaked memory in rust main loop" ) {
@@ -295,7 +321,8 @@ fn check_running(exe_filename: str) -> happiness {
295
321
100 { cleanly_rejected ( "running: explicit fail" ) }
296
322
101 | 247 { cleanly_rejected ( "running: timed out" ) }
297
323
245 | 246 { known_bug ( "https://github.com/graydon/rust/issues/32 ??" ) }
298
- rc { failed( "exited with status " + int:: str ( rc) ) }
324
+ 136 | 248 { known_bug ( "SIGFPE - https://github.com/graydon/rust/issues/944" ) }
325
+ rc { failed( "Rust program ran but exited with status " + int:: str ( rc) ) }
299
326
}
300
327
}
301
328
}
@@ -312,11 +339,17 @@ fn check_compiling(filename: str) -> happiness {
312
339
//log_err #fmt("Status: %d", p.status);
313
340
if p. err != "" {
314
341
if contains ( p. err , "May only branch on boolean predicates" ) {
315
- known_bug ( "https://github.com/graydon/rust/issues/892" )
342
+ known_bug ( "https://github.com/graydon/rust/issues/892 or https://github.com/graydon/rust/issues/943" )
343
+ } else if contains ( p. err , "All operands to PHI node must be the same type as the PHI node!" ) {
344
+ known_bug ( "https://github.com/graydon/rust/issues/943" )
316
345
} else if contains ( p. err , "(S->getType()->isPointerTy() && \" Invalid cast\" )" ) {
317
346
known_bug ( "https://github.com/graydon/rust/issues/895" )
347
+ } else if contains ( p. out , "Ptr must be a pointer to Val type" ) {
348
+ known_bug ( "https://github.com/graydon/rust/issues/897" )
318
349
} else if contains ( p. err , "(castIsValid(op, S, Ty) && \" Invalid cast!\" ), function Create" ) {
319
350
known_bug ( "https://github.com/graydon/rust/issues/901" )
351
+ } else if contains ( p. err , "Invoking a function with a bad signature!" ) {
352
+ known_bug ( "https://github.com/graydon/rust/issues/946" )
320
353
} else {
321
354
log_err "Stderr: " + p. err ;
322
355
failed ( "Unfamiliar error message" )
@@ -332,8 +365,6 @@ fn check_compiling(filename: str) -> happiness {
332
365
known_bug ( "https://github.com/graydon/rust/issues/924" )
333
366
} else if contains ( p. out , "Assertion failed: (S->getType()->isPointerTy() && \" Invalid cast\" )" ) {
334
367
known_bug ( "https://github.com/graydon/rust/issues/935" )
335
- } else if contains ( p. out , "Ptr must be a pointer to Val type" ) {
336
- known_bug ( "https://github.com/graydon/rust/issues/897" )
337
368
} else if contains ( p. out , "Assertion" ) && contains ( p. out , "failed" ) {
338
369
log_err "Stdout: " + p. out ;
339
370
failed ( "Looks like an llvm assertion failure" )
@@ -393,7 +424,9 @@ fn content_is_dangerous_to_run(code: str) -> bool {
393
424
let dangerous_patterns =
394
425
[ "import" , // espeically fs, run
395
426
"native" ,
396
- "unsafe" ] ;
427
+ "unsafe" ,
428
+ "with" , // tstate hang: https://github.com/graydon/rust/issues/948
429
+ "log" ] ; // python --> rust pipe deadlock?
397
430
398
431
for p: str in dangerous_patterns { if contains ( code, p) { ret true ; } }
399
432
ret false;
0 commit comments