Fix GetCachedProg() for OnePass.

Change-Id: Ifb0ab3842c46e1598cfdf4ccf3f558354f7a3f94
Reviewed-on: https://code-review.googlesource.com/c/re2/+/58672
Reviewed-by: Paul Wankadia <junyer@google.com>
diff --git a/re2/testing/regexp_benchmark.cc b/re2/testing/regexp_benchmark.cc
index 5050286..3f86ccc 100644
--- a/re2/testing/regexp_benchmark.cc
+++ b/re2/testing/regexp_benchmark.cc
@@ -953,6 +953,8 @@
     CHECK(prog);
     cache[regexp] = prog;
     re->Decref();
+    // We must call this here - while we have exclusive access.
+    prog->IsOnePass();
   }
   return prog;
 }