Opened 8 months ago

Closed 6 months ago

#6138 closed defect (worksforme)

[emscripten] DependentString constructor creates a valid empty string if constructed from an invalid DependentString() instance

Reported by: sergz Assignee: hfiguiere
Priority: Unknown Milestone:
Module: Core Keywords:
Cc: hfiguiere Blocked By:
Blocking: Platform: Unknown / Cross platform
Ready: no Confidential: no
Tester: Unknown Verified working: no
Review URL(s):

Description (last modified by hfiguiere)

Noticed in https://codereview.adblockplus.org/29572731/diff/29581584/compiled/StringMap.h#newcode32.

DependentString constructor should set flags in accordance to the flags of a source object and the type of the argument (the latter it just for reference, since it's already done).

Change History (5)

comment:1 Changed 8 months ago by hfiguiere

  • Description modified (diff)
  • Summary changed from DepedentString constructor creates a valid empty string if constructed from an invalid DependentString() instance to [emscripten] DependentString constructor creates a valid empty string if constructed from an invalid DependentString() instance

comment:2 Changed 8 months ago by hfiguiere

Also OwnedString() make a "valid" string. (there is no default constructor, but one that has a default argument value), which break if we'd try to have a StringMap with OwnedString as a key.

https://codereview.adblockplus.org/29587914/diff/29618581/compiled/String.h#newcode284

comment:3 Changed 8 months ago by hfiguiere

  • Owner set to hfiguiere

comment:4 Changed 8 months ago by fhd

  • Cc trev removed

comment:5 Changed 6 months ago by hfiguiere

  • Resolution set to worksforme
  • Status changed from new to closed

From the test we have I believe this bug is no more.

There is an implicit copy constructor called that does the job.

See https://hg.adblockplus.org/adblockpluscore/file/a798e9a8a351/test/compiled/String.cpp#l30

Note: See TracTickets for help on using tickets.