diff options
author | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-28 16:39:48 +0300 |
---|---|---|
committer | Tor Lillqvist <tlillqvist@suse.com> | 2012-03-28 16:57:58 +0300 |
commit | c589fa17b8f3e6ded0d1e04120781eb5d6735bc7 (patch) | |
tree | 573615500bdcc3f4bf71b584b0f91a75e87d72ef /codemaker | |
parent | e320d81cd8b4dd1bd9b15892c616a99f48c93567 (diff) |
Dalvik enforces byte constants being in range (-128..127)
Diffstat (limited to 'codemaker')
-rw-r--r-- | codemaker/source/javamaker/javatype.cxx | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/codemaker/source/javamaker/javatype.cxx b/codemaker/source/javamaker/javatype.cxx index 1453122ce749..f297980f397a 100644 --- a/codemaker/source/javamaker/javatype.cxx +++ b/codemaker/source/javamaker/javatype.cxx @@ -2447,7 +2447,10 @@ void addConstant( rtl::OString( RTL_CONSTASCII_STRINGPARAM("Bad type information"))); //TODO } - valueIndex = classFile->addIntegerInfo(fieldValue.m_value.aByte); + if (fieldValue.m_value.aByte < 0x80) + valueIndex = classFile->addIntegerInfo(fieldValue.m_value.aByte); + else + valueIndex = classFile->addIntegerInfo(-256 + (int) fieldValue.m_value.aByte); break; case codemaker::UnoType::SORT_SHORT: |