[CSA] Improve error mesage when re-binding the same label

Change-Id: I102558ee4fac29e5bc259117129a47632cc8bd58
Reviewed-on: https://chromium-review.googlesource.com/505508
Reviewed-by: Jaroslav Sevcik <jarin@chromium.org>
Commit-Queue: Camillo Bruni <cbruni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45311}
This commit is contained in:
Camillo Bruni 2017-05-15 10:39:41 +02:00 committed by Commit Bot
parent f8a6c6c48e
commit 02c032c601

View File

@ -996,7 +996,13 @@ void CodeAssemblerLabel::MergeVariables() {
#if DEBUG
void CodeAssemblerLabel::Bind(AssemblerDebugInfo debug_info) {
DCHECK(!bound_);
if (bound_) {
std::stringstream str;
str << "Cannot bind the same label twice:"
<< "\n# current: " << debug_info
<< "\n# previous: " << *label_->block();
FATAL(str.str().c_str());
}
state_->raw_assembler_->Bind(label_, debug_info);
UpdateVariablesAfterBind();
}