From 56da63e3bc5fc325c6d07c8e4aced60adce5ce21 Mon Sep 17 00:00:00 2001 From: klzgrad Date: Mon, 22 Jan 2024 00:27:05 +0800 Subject: [PATCH] url: Work around Clang miscompile on mips64el --- src/url/url_canon_ip.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/url/url_canon_ip.cc b/src/url/url_canon_ip.cc index 4a98592012..0bfbe4e86a 100644 --- a/src/url/url_canon_ip.cc +++ b/src/url/url_canon_ip.cc @@ -149,7 +149,10 @@ CanonHostInfo::Family DoIPv4AddressToNumber(const CHAR* spec, while (true) { // If this is not the first character of a component, go to the next // component. - if (current_position != host.begin && spec[current_position - 1] != '.') { + // XXX: On mips64el, using + // `current_position != host.begin && spec[current_position - 1] != '.'` + // would have current_position going to the negative. + if (current_position > host.begin && spec[current_position - 1] != '.') { --current_position; continue; }