Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
int
Rust
提交
70222b7e
R
Rust
项目概览
int
/
Rust
大约 1 年 前同步成功
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
Rust
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
70222b7e
编写于
5月 21, 2013
作者:
S
Seo Sanghyeon
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary allocations flagged by lint from fuzzer
上级
d4724c1a
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
23 addition
and
23 deletion
+23
-23
src/libfuzzer/fuzzer.rc
src/libfuzzer/fuzzer.rc
+23
-23
未找到文件。
src/libfuzzer/fuzzer.rc
浏览文件 @
70222b7e
...
...
@@ -38,7 +38,7 @@ pub enum test_mode { tm_converge, tm_run, }
pub struct Context { mode: test_mode } // + rng
pub fn write_file(filename: &Path, content: &str) {
result::get(&io::file_writer(filename,
~
[io::Create, io::Truncate]))
result::get(&io::file_writer(filename, [io::Create, io::Truncate]))
.write_str(content);
}
...
...
@@ -47,12 +47,12 @@ pub fn contains(haystack: &str, needle: &str) -> bool {
}
pub fn find_rust_files(files: &mut ~[Path], path: &Path) {
if path.filetype() == Some(~".rs") && !contains(path.to_str(),
~
"utf8") {
if path.filetype() == Some(~".rs") && !contains(path.to_str(), "utf8") {
// ignoring "utf8" tests because something is broken
files.push(path.clone());
} else if os::path_is_dir(path)
&& !contains(path.to_str(),
~
"compile-fail")
&& !contains(path.to_str(),
~
"build") {
&& !contains(path.to_str(), "compile-fail")
&& !contains(path.to_str(), "build") {
for os::list_dir_path(path).each |p| {
find_rust_files(&mut *files, *p);
}
...
...
@@ -406,34 +406,34 @@ pub fn check_whole_compiler(code: &str,
pub fn removeIfExists(filename: &Path) {
// So sketchy!
assert!(!contains(filename.to_str(),
~
" "));
run::program_output(
~"bash", ~
[~"-c", ~"rm " + filename.to_str()]);
assert!(!contains(filename.to_str(), " "));
run::program_output(
"bash",
[~"-c", ~"rm " + filename.to_str()]);
}
pub fn removeDirIfExists(filename: &Path) {
// So sketchy!
assert!(!contains(filename.to_str(),
~
" "));
run::program_output(
~"bash", ~
[~"-c", ~"rm -r " + filename.to_str()]);
assert!(!contains(filename.to_str(), " "));
run::program_output(
"bash",
[~"-c", ~"rm -r " + filename.to_str()]);
}
pub fn check_running(exe_filename: &Path) -> happiness {
let p = run::program_output(
~
"/Users/jruderman/scripts/timed_run_rust_program.py",
~
[exe_filename.to_str()]);
"/Users/jruderman/scripts/timed_run_rust_program.py",
[exe_filename.to_str()]);
let comb = p.out + ~"\n" + p.err;
if str::len(comb) > 1u {
error!("comb comb comb: %?", comb);
}
if contains(comb,
~
"Assertion failed:") {
if contains(comb, "Assertion failed:") {
failed(~"C++ assertion failure")
} else if contains(comb,
~
"leaked memory in rust main loop") {
} else if contains(comb, "leaked memory in rust main loop") {
// might also use exit code 134
//failed("Leaked")
known_bug(~"https://github.com/mozilla/rust/issues/910")
} else if contains(comb,
~
"src/rt/") {
} else if contains(comb, "src/rt/") {
failed(~"Mentioned src/rt/")
} else if contains(comb,
~
"malloc") {
} else if contains(comb, "malloc") {
failed(~"Mentioned malloc")
} else {
match p.status {
...
...
@@ -457,26 +457,26 @@ pub fn check_running(exe_filename: &Path) -> happiness {
pub fn check_compiling(filename: &Path) -> happiness {
let p = run::program_output(
~
"/Users/jruderman/code/rust/build/x86_64-apple-darwin/\
"/Users/jruderman/code/rust/build/x86_64-apple-darwin/\
stage1/bin/rustc",
~
[filename.to_str()]);
[filename.to_str()]);
//error!("Status: %d", p.status);
if p.status == 0 {
passed
} else if p.err != ~"" {
if contains(p.err,
~
"error:") {
if contains(p.err, "error:") {
cleanly_rejected(~"rejected with span_error")
} else {
error!("Stderr: %?", p.err);
failed(~"Unfamiliar error message")
}
} else if contains(p.out,
~"Assertion") && contains(p.out, ~
"failed") {
} else if contains(p.out,
"Assertion") && contains(p.out,
"failed") {
error!("Stdout: %?", p.out);
failed(~"Looks like an llvm assertion failure")
} else if contains(p.out,
~
"internal compiler error unimplemented") {
} else if contains(p.out, "internal compiler error unimplemented") {
known_bug(~"Something unimplemented")
} else if contains(p.out,
~
"internal compiler error") {
} else if contains(p.out, "internal compiler error") {
error!("Stdout: %?", p.out);
failed(~"internal compiler error")
...
...
@@ -603,8 +603,8 @@ pub fn check_roundtrip_convergence(code: @~str, maxIters: uint) {
error!("Did not converge after %u iterations!", i);
write_file(&Path("round-trip-a.rs"), *oldv);
write_file(&Path("round-trip-b.rs"), *newv);
run::run_program(
~
"diff",
~
[~"-w", ~"-u", ~"round-trip-a.rs",
run::run_program("diff",
[~"-w", ~"-u", ~"round-trip-a.rs",
~"round-trip-b.rs"]);
fail!("Mismatch");
}
...
...
@@ -635,7 +635,7 @@ pub fn check_variants(files: &[Path], cx: Context) {
}
let s = @result::get(&io::read_whole_file_str(file));
if contains(*s,
~
"#") {
if contains(*s, "#") {
loop; // Macros are confusing
}
if cx.mode == tm_converge && content_might_not_converge(*s) {
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录