Closed Bug 1604188 Opened 8 months ago Closed 7 months ago

Replace unreachable String functions calling MOZ_ASSERT_UNREACHABLE/MOZ_CRASH with if-constexpr

Categories

(Core :: JavaScript Engine, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla74
Tracking Status
firefox73 --- wontfix
firefox74 --- fixed

People

(Reporter: anba, Assigned: anba)

Details

Attachments

(1 file)

For example we can avoid writing this Final_Sigma function:

static Latin1Char Final_Sigma(const Latin1Char* chars, size_t length,
                              size_t index) {
  MOZ_ASSERT_UNREACHABLE("U+03A3 is not a Latin-1 character");
  return 0;
}

when the call sites use if-constexpr to only call Final_Sigma for char16_t.

Instead of using MOZ_CRASH/MOZ_ASSERT_UNREACHABLE for unreachable functions, we can
now use if-constexpr to avoid generating the unreachable calls in the first place.

Priority: -- → P1
Pushed by apavel@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/1dfdd760665d
Replace unreachable string functions with if-constexpr code. r=jandem,jwalden
Status: ASSIGNED → RESOLVED
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.