Skip to content

Commit

Permalink
change where const length is set
Browse files Browse the repository at this point in the history
  • Loading branch information
huangminghuang committed Nov 25, 2021
1 parent f200129 commit 99e0daa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/mfast/coder/decoder_v2/fast_decoder_core.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ void fast_decoder_base::decode_field(const T &ext_ref, constant_operator_tag,
// A field will not occupy any bit in the presence map if it is mandatory
// and has the
// constant operator.
// mref.to_initial_value();
mref.to_initial_value();
}
if (ext_ref.previous_value_shared())
save_previous_value(mref);
Expand Down
6 changes: 1 addition & 5 deletions src/mfast/ext_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,8 @@ class ext_mref<sequence_mref, LengthExtRef, ElementExtRef> {
cref_type get() const { return base_; }
is_optional_type optional() const { return is_optional_type(); }
length_type set_length(value_storage &storage) const {
auto* length_inst = base_.instruction()->length_instruction();
field_mref_base length_mref(nullptr, &storage,
length_inst);
// a temporary storage is used for sequence length field
// and we must initialize it properly to support constant operators
length_inst->construct_value(storage, nullptr);
base_.instruction()->length_instruction());
return length_type(length_mref);
}

Expand Down

0 comments on commit 99e0daa

Please sign in to comment.