diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc index 8432df50215..c2c6c11b498 100644 --- a/runtime/vm/object.cc +++ b/runtime/vm/object.cc @@ -27184,15 +27184,15 @@ void RegExp::set_bytecode(bool is_one_byte, const TypedData& bytecode) const { if (sticky) { if (is_one_byte) { - untag()->set_one_byte_sticky(bytecode.ptr()); + untag()->set_one_byte_sticky(bytecode.ptr()); } else { - untag()->set_two_byte_sticky(bytecode.ptr()); + untag()->set_two_byte_sticky(bytecode.ptr()); } } else { if (is_one_byte) { - untag()->set_one_byte(bytecode.ptr()); + untag()->set_one_byte(bytecode.ptr()); } else { - untag()->set_two_byte(bytecode.ptr()); + untag()->set_two_byte(bytecode.ptr()); } } } diff --git a/runtime/vm/object.h b/runtime/vm/object.h index dbfd737dc10..891b1b539d6 100644 --- a/runtime/vm/object.h +++ b/runtime/vm/object.h @@ -12484,8 +12484,9 @@ class RegExp : public Instance { bool is_complex() const { return (type() == kComplex); } intptr_t num_registers(bool is_one_byte) const { - return is_one_byte ? untag()->num_one_byte_registers_ - : untag()->num_two_byte_registers_; + return LoadNonPointer( + is_one_byte ? &untag()->num_one_byte_registers_ + : &untag()->num_two_byte_registers_); } StringPtr pattern() const { return untag()->pattern(); } @@ -12496,11 +12497,13 @@ class RegExp : public Instance { TypedDataPtr bytecode(bool is_one_byte, bool sticky) const { if (sticky) { - return TypedData::RawCast(is_one_byte ? untag()->one_byte_sticky() - : untag()->two_byte_sticky()); + return TypedData::RawCast( + is_one_byte ? untag()->one_byte_sticky() + : untag()->two_byte_sticky()); } else { - return TypedData::RawCast(is_one_byte ? untag()->one_byte() - : untag()->two_byte()); + return TypedData::RawCast( + is_one_byte ? untag()->one_byte() + : untag()->two_byte()); } } @@ -12590,11 +12593,10 @@ class RegExp : public Instance { void set_is_simple() const { set_type(kSimple); } void set_is_complex() const { set_type(kComplex); } void set_num_registers(bool is_one_byte, intptr_t value) const { - if (is_one_byte) { - StoreNonPointer(&untag()->num_one_byte_registers_, value); - } else { - StoreNonPointer(&untag()->num_two_byte_registers_, value); - } + StoreNonPointer( + is_one_byte ? &untag()->num_one_byte_registers_ + : &untag()->num_two_byte_registers_, + value); } RegExpFlags flags() const {