Fix ATN deserialisation for unicode chars FFFE and FFFF

This commit is contained in:
Eric Vergnaud 2017-06-25 12:05:57 +08:00
parent 94ca69b727
commit ff4ffa613b
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ class ATNDeserializer (object):
def reset(self, data):
def adjust(c):
v = ord(c)
return v-2 if v>1 else -1
return v-2 if v>1 else v + 65533
temp = [ adjust(c) for c in data ]
# don't adjust the first value since that's the version number
temp[0] = ord(data[0])

View File

@ -86,7 +86,7 @@ class ATNDeserializer (object):
def reset(self, data:str):
def adjust(c):
v = ord(c)
return v-2 if v>1 else -1
return v-2 if v>1 else v + 65533
temp = [ adjust(c) for c in data ]
# don't adjust the first value since that's the version number
temp[0] = ord(data[0])