Closed Bug 1604188 Opened 5 years ago Closed 5 years 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: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla74
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: