summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-06-10 10:48:34 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-06-10 10:48:34 +0800
commite205ae4024312fe6ddd437ae0ac12990d103bb45 (patch)
treec9956b5f459d33db89b9cd7a311c4387830f56a8
parent374a42466ee4e9d0a25ef65f73b84e3c870d6f79 (diff)
downloadmrust-e205ae4024312fe6ddd437ae0ac12990d103bb45.tar.gz
MIR Gen - Fix incorrect codegen due to defaulting to 0 not ~0
-rw-r--r--src/main.cpp3
-rw-r--r--src/mir/mir_builder.cpp4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 1b09b79b..af999dae 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -63,6 +63,7 @@ void init_debug_list()
g_debug_disable_map.insert( "Dump HIR" );
g_debug_disable_map.insert( "Lower MIR" );
g_debug_disable_map.insert( "MIR Validate" );
+ g_debug_disable_map.insert( "MIR Validate Full Early" );
g_debug_disable_map.insert( "Dump MIR" );
g_debug_disable_map.insert( "Constant Evaluate Full" );
g_debug_disable_map.insert( "MIR Cleanup" );
@@ -450,7 +451,7 @@ int main(int argc, char *argv[])
});
if( getenv("MRUSTC_FULL_VALIDATE_PREOPT") )
{
- CompilePhaseV("MIR Validate Full", [&]() {
+ CompilePhaseV("MIR Validate Full Early", [&]() {
MIR_CheckCrate_Full(*hir_crate);
});
}
diff --git a/src/mir/mir_builder.cpp b/src/mir/mir_builder.cpp
index 478146e8..f03dc40f 100644
--- a/src/mir/mir_builder.cpp
+++ b/src/mir/mir_builder.cpp
@@ -355,7 +355,7 @@ void MirBuilder::push_stmt_asm(const Span& sp, ::MIR::Statement::Data_Asm data)
}
void MirBuilder::push_stmt_set_dropflag_val(const Span& sp, unsigned int idx, bool value)
{
- this->push_stmt(sp, ::MIR::Statement::make_SetDropFlag({ idx, value }));
+ this->push_stmt(sp, ::MIR::Statement::make_SetDropFlag({ idx, value, ~0u }));
}
void MirBuilder::push_stmt_set_dropflag_other(const Span& sp, unsigned int idx, unsigned int other)
{
@@ -363,7 +363,7 @@ void MirBuilder::push_stmt_set_dropflag_other(const Span& sp, unsigned int idx,
}
void MirBuilder::push_stmt_set_dropflag_default(const Span& sp, unsigned int idx)
{
- this->push_stmt(sp, ::MIR::Statement::make_SetDropFlag({ idx, this->get_drop_flag_default(sp, idx) }));
+ this->push_stmt(sp, ::MIR::Statement::make_SetDropFlag({ idx, this->get_drop_flag_default(sp, idx), ~0u }));
}
void MirBuilder::push_stmt(const Span& sp, ::MIR::Statement stmt)
{