From 13807824140bd7f49b1d9deb794f35b16936ddca Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Mon, 3 Apr 2023 11:18:46 +0200 Subject: Upgrade regex to 1.7.3 This project was upgraded with external_updater. Usage: tools/external_updater/updater.sh update rust/crates/regex For more info, check https://cs.android.com/android/platform/superproject/+/master:tools/external_updater/README.md Test: TreeHugger Change-Id: I1b2a14fe41eb3ba57e463b822c6bf112d84b9946 --- .cargo_vcs_info.json | 2 +- Android.bp | 22 +++++++++++----------- CHANGELOG.md | 21 +++++++++++++++++++++ Cargo.toml | 4 ++-- Cargo.toml.orig | 4 ++-- METADATA | 8 ++++---- src/exec.rs | 4 ++-- tests/test_default.rs | 10 ++++++++++ 8 files changed, 53 insertions(+), 22 deletions(-) diff --git a/.cargo_vcs_info.json b/.cargo_vcs_info.json index 1e6254f..a82e282 100644 --- a/.cargo_vcs_info.json +++ b/.cargo_vcs_info.json @@ -1,6 +1,6 @@ { "git": { - "sha1": "a9b2e02352db92ce1f6e5b7ecd41b8bbffbe161a" + "sha1": "9582040009820380a16819ca0d1ae262c7d454b0" }, "path_in_vcs": "" } \ No newline at end of file diff --git a/Android.bp b/Android.bp index c84be92..5b27d25 100644 --- a/Android.bp +++ b/Android.bp @@ -43,7 +43,7 @@ rust_library { host_supported: true, crate_name: "regex", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["src/lib.rs"], edition: "2018", features: [ @@ -84,7 +84,7 @@ rust_test { host_supported: true, crate_name: "regex", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["src/lib.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -126,7 +126,7 @@ rust_test { host_supported: true, crate_name: "backtrack", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_backtrack.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -169,7 +169,7 @@ rust_test { host_supported: true, crate_name: "backtrack_bytes", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_backtrack_bytes.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -212,7 +212,7 @@ rust_test { host_supported: true, crate_name: "backtrack_utf8bytes", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_backtrack_utf8bytes.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -255,7 +255,7 @@ rust_test { host_supported: true, crate_name: "crates_regex", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_crates_regex.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -298,7 +298,7 @@ rust_test { host_supported: true, crate_name: "default", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_default.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -341,7 +341,7 @@ rust_test { host_supported: true, crate_name: "default_bytes", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_default_bytes.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -384,7 +384,7 @@ rust_test { host_supported: true, crate_name: "nfa", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_nfa.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -427,7 +427,7 @@ rust_test { host_supported: true, crate_name: "nfa_bytes", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_nfa_bytes.rs"], test_suites: ["general-tests"], auto_gen_config: true, @@ -470,7 +470,7 @@ rust_test { host_supported: true, crate_name: "nfa_utf8bytes", cargo_env_compat: true, - cargo_pkg_version: "1.7.1", + cargo_pkg_version: "1.7.3", srcs: ["tests/test_nfa_utf8bytes.rs"], test_suites: ["general-tests"], auto_gen_config: true, diff --git a/CHANGELOG.md b/CHANGELOG.md index 466f5a9..44274ac 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,24 @@ +1.7.3 (2023-03-24) +================== +This is a small release that fixes a bug in `Regex::shortest_match_at` that +could cause it to panic, even when the offset given is valid. + +Bug fixes: + +* [BUG #969](https://github.com/rust-lang/regex/issues/969): + Fix a bug in how the reverse DFA was called for `Regex::shortest_match_at`. + + +1.7.2 (2023-03-21) +================== +This is a small release that fixes a failing test on FreeBSD. + +Bug fixes: + +* [BUG #967](https://github.com/rust-lang/regex/issues/967): + Fix "no stack overflow" test which can fail due to the small stack size. + + 1.7.1 (2023-01-09) ================== This release was done principally to try and fix the doc.rs rendering for the diff --git a/Cargo.toml b/Cargo.toml index 4f8673e..37e44fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "regex" -version = "1.7.1" +version = "1.7.3" authors = ["The Rust Project Developers"] exclude = [ "/scripts/*", @@ -88,7 +88,7 @@ version = "2.4.0" optional = true [dependencies.regex-syntax] -version = "0.6.27" +version = "0.6.29" default-features = false [dev-dependencies.lazy_static] diff --git a/Cargo.toml.orig b/Cargo.toml.orig index 1dc7f56..4c5bd1c 100644 --- a/Cargo.toml.orig +++ b/Cargo.toml.orig @@ -1,6 +1,6 @@ [package] name = "regex" -version = "1.7.1" #:version +version = "1.7.3" #:version authors = ["The Rust Project Developers"] license = "MIT OR Apache-2.0" readme = "README.md" @@ -117,7 +117,7 @@ optional = true # For parsing regular expressions. [dependencies.regex-syntax] path = "regex-syntax" -version = "0.6.27" +version = "0.6.29" default-features = false [dev-dependencies] diff --git a/METADATA b/METADATA index 6525202..f8d1a17 100644 --- a/METADATA +++ b/METADATA @@ -11,13 +11,13 @@ third_party { } url { type: ARCHIVE - value: "https://static.crates.io/crates/regex/regex-1.7.1.crate" + value: "https://static.crates.io/crates/regex/regex-1.7.3.crate" } - version: "1.7.1" + version: "1.7.3" license_type: NOTICE last_upgrade_date { year: 2023 - month: 2 - day: 17 + month: 4 + day: 3 } } diff --git a/src/exec.rs b/src/exec.rs index e75ca08..b9abcdc 100644 --- a/src/exec.rs +++ b/src/exec.rs @@ -459,7 +459,7 @@ impl<'c> RegularExpression for ExecNoSync<'c> { self.cache.value(), true, &text[start..], - text.len(), + text.len() - start, ) { dfa::Result::Match(_) => Some(text.len()), dfa::Result::NoMatch(_) => None, @@ -511,7 +511,7 @@ impl<'c> RegularExpression for ExecNoSync<'c> { self.cache.value(), true, &text[start..], - text.len(), + text.len() - start, ) { dfa::Result::Match(_) => true, dfa::Result::NoMatch(_) => false, diff --git a/tests/test_default.rs b/tests/test_default.rs index be627f7..19a319a 100644 --- a/tests/test_default.rs +++ b/tests/test_default.rs @@ -220,3 +220,13 @@ fn empty_alt_regex_fails() { let result = Regex::new(r"(?:|){4294967295}"); assert!(result.is_err()); } + +// Regression test for: https://github.com/rust-lang/regex/issues/969 +#[test] +fn regression_i969() { + use regex::Regex; + + let re = Regex::new(r"c.*d\z").unwrap(); + assert_eq!(Some(6), re.shortest_match_at("ababcd", 4)); + assert_eq!(Some(6), re.find_at("ababcd", 4).map(|m| m.end())); +} -- cgit v1.2.3