mirror of
https://github.com/openjdk/jdk.git
synced 2026-04-03 19:48:46 +00:00
8134541: latent concurrency bug in ScriptRunData
Reviewed-by: honkar, dnguyen, serb
This commit is contained in:
parent
48132fbb65
commit
e191df7f15
@ -38,11 +38,12 @@ public final class ScriptRunData {
|
||||
private static final int CHAR_START = 0;
|
||||
private static final int CHAR_LIMIT = 0x110000;
|
||||
|
||||
private static int cache = 0;
|
||||
private static volatile int cache = 0;
|
||||
public static int getScript(int cp) {
|
||||
int lcache = cache;
|
||||
// optimize for runs of characters in the same script
|
||||
if (cp >= data[cache] && cp < data[cache+2]) {
|
||||
return data[cache+1];
|
||||
if (cp >= data[lcache] && cp < data[lcache+2]) {
|
||||
return data[lcache+1];
|
||||
}
|
||||
if ((cp >= CHAR_START) && (cp < CHAR_LIMIT)) {
|
||||
int probe = dataPower;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user