summaryrefslogtreecommitdiff
path: root/compiler/utils/label.h
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/utils/label.h')
-rw-r--r--compiler/utils/label.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/compiler/utils/label.h b/compiler/utils/label.h
index ff4a1a4333..1038f44ffe 100644
--- a/compiler/utils/label.h
+++ b/compiler/utils/label.h
@@ -70,6 +70,13 @@ class Label {
public:
Label() : position_(0) {}
+ Label(Label&& src)
+ : position_(src.position_) {
+ // We must unlink/unbind the src label when moving; if not, calling the destructor on
+ // the src label would fail.
+ src.position_ = 0;
+ }
+
~Label() {
// Assert if label is being destroyed with unresolved branches pending.
CHECK(!IsLinked());