Skip to content

fix: Use better swizzled methods prefix to avoid collisions with possible existing methods in the class hierarchy - #46

Merged
rigor789 merged 1 commit into
masterfrom
darind/swizzled-methods-prefix-fix
Jun 5, 2020
Merged

rigor789 merged 1 commit into
masterfrom
darind/swizzled-methods-prefix-fix

Conversation

@darind

@darind darind commented Jun 5, 2020 •

Copy link
Copy Markdown
Collaborator

Fixes #34 and #43 in which we have a collision with an existing method name for UINavigationController.__viewWillappear: and which results in the following errors to be logged when starting up an application:

Unbalanced calls to begin/end appearance transitions for <UINavigationControllerImpl: 0x7ff555057200>

The application might crash as a result of this.

…ible existing methods in the class hierarchy
@darind darind added the bug Something isn't working label Jun 5, 2020
@darind darind self-assigned this Jun 5, 2020
@cla-bot cla-bot Bot added the cla: yes label Jun 5, 2020
@rigor789
rigor789 merged commit 16ffea5 into master Jun 5, 2020
edusperoni added a commit that referenced this pull request Nov 25, 2026
…or IDNA (#606)

* perf(runtime): keep ada's symbols out of the framework's exports

ada's functions had default visibility, so the NativeScript dylib exported
them and -dead_strip kept all of ada as roots, including the ada::url parser,
the URLPattern route-set compiler and the C API that the runtime never calls.
Compile ada.cpp with -fvisibility=hidden and unexport the ada symbols that
runtime TUs emit as weak inline definitions, which also keeps the linker from
warning about mixed-visibility weak symbols.

Release arm64: ada's linked bytes 400.8 KB -> 263.8 KB.

* feat(runtime): optional system ICU for ada's Unicode tables

NS_ADA_SYSTEM_IDNA (off by default) routes ada's UTS #46 host conversion and
URLPattern's identifier code point check to libicucore (uidna_openUTS46,
u_hasBinaryProperty), so ada's compressed Unicode tables dead-strip.
libicucore is autolinked from system_idna.cpp only when the flag is on.

The options mirror Chromium/WebKit/swift-foundation (nontransitional,
CheckBidi, CheckJoiners; hyphen and DNS-length errors ignored) and all-ASCII
domains are lowercased without ICU, as WHATWG and ada do. On iOS 26.0.1
(ICU 76.1) it passes WPT toascii 87/87 and IdnaTestV2 2665/2676; the misses
are characters newer than Unicode 16. Older iOS ships older Unicode data, so
host results follow the OS version.

Release arm64 with the flag on: ada 263.9 KB -> 182.2 KB.

* perf(runtime): parse each URL once and drop std::regex from console

new URL(input, base) called ada::can_parse, which parses base and input, then
parsed both again; it now parses each once. URL.canParse uses ada::parse too,
so ada::can_parse and its second parser instantiation dead-strip. canParse
also stops truncating its input at an embedded NUL, and a base whose
toString() throws now propagates the exception instead of aborting.

Console's stack-frame check used two std::regex patterns; a hand-written
matcher with the same semantics (fuzzed against std::regex on 2M mutated
frames) removes std::regex from the framework.

Release arm64 __TEXT: -69 KB (ada -21.8 KB, Console -40.4 KB).

* test(runtime): cover URL bases, canParse, IDN hosts and non-ASCII URLPattern names

* fix(runtime): URL.canParse treats an undefined base as absent

* fix(runtime): keep ada's non-ASCII domain length limit in the system ICU path
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working cla: yes

2 participants