Commit 1354ff93 authored by Michael Starzinger's avatar Michael Starzinger Committed by Commit Bot

[turbofan] Disallow copying of {CodeAssemblerLabel}.

R=tebbi@chromium.org
BUG=chromium:931536

Change-Id: I3a6dbabec7a84f55d6aa85934dca37af55390552
Reviewed-on: https://chromium-review.googlesource.com/c/1473034Reviewed-by: 's avatarTobias Tebbi <tebbi@chromium.org>
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#59601}
parent e4fbac98
......@@ -367,9 +367,9 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) {
TYPED_ARRAYS(INSTANCE_TYPE)
#undef INSTANCE_TYPE
};
std::vector<Label> labels;
std::list<Label> labels;
for (size_t i = 0; i < instance_types.size(); ++i) {
labels.push_back(Label(this));
labels.emplace_back(this);
}
std::vector<Label*> label_ptrs;
for (Label& label : labels) {
......@@ -390,8 +390,9 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) {
Switch(instance_type, &unexpected_instance_type, instance_types.data(),
label_ptrs.data(), labels.size());
for (size_t i = 0; i < labels.size(); ++i) {
BIND(&labels[i]);
size_t i = 0;
for (auto it = labels.begin(); it != labels.end(); ++i, ++it) {
BIND(&*it);
Label done(this);
source_elements_kind_ = ElementsKindForInstanceType(
static_cast<InstanceType>(instance_types[i]));
......
......@@ -1572,6 +1572,10 @@ class CodeAssemblerLabel {
std::map<CodeAssemblerVariable::Impl*, std::vector<Node*>,
CodeAssemblerVariable::ImplComparator>
variable_merges_;
// Cannot be copied because the destructor explicitly call the destructor of
// the underlying {RawMachineLabel}, hence only one pointer can point to it.
DISALLOW_COPY_AND_ASSIGN(CodeAssemblerLabel);
};
class CodeAssemblerParameterizedLabelBase {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment