1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 20:51:52 +01:00

Check for errors when calling lto_codegen_add_module in the gold plugin.

Thanks to Milan Lenčo for noticing it.

llvm-svn: 192996
This commit is contained in:
Rafael Espindola 2013-10-18 19:32:06 +00:00
parent 822ccff656
commit 991f723e21

View File

@ -351,8 +351,13 @@ static ld_plugin_status claim_file_hook(const ld_plugin_input_file *file,
}
}
if (code_gen)
lto_codegen_add_module(code_gen, M);
if (code_gen) {
if (lto_codegen_add_module(code_gen, M)) {
(*message)(LDPL_ERROR, "Error linking module: %s",
lto_get_error_message());
return LDPS_ERR;
}
}
lto_module_dispose(M);