diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-09-19 08:15:03 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-09-19 08:15:03 +0200 |
commit | dc331015a5620815ef9349e69816a7fd300158eb (patch) | |
tree | 6f8136649abcf11ff7e96a619a662b60b5854cf9 /unoidl | |
parent | 0395d4ba7b55736c53a53beb427ce750158e769f (diff) |
Handle special case -(2^63) correctly
Change-Id: Ia3d8931341b2d47ef76265d94410d83f51a068c0
Diffstat (limited to 'unoidl')
-rw-r--r-- | unoidl/source/sourceprovider-parser.y | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/unoidl/source/sourceprovider-parser.y b/unoidl/source/sourceprovider-parser.y index 9c7e00e37b65..4d4f8e692b64 100644 --- a/unoidl/source/sourceprovider-parser.y +++ b/unoidl/source/sourceprovider-parser.y @@ -3078,15 +3078,19 @@ unaryExpr: $$ = unoidl::detail::SourceProviderExpr::Int(-$2.ival); break; case unoidl::detail::SourceProviderExpr::TYPE_UINT: - if ($2.uval > SAL_MAX_INT64) { - error( - @2, yyscanner, - ("cannot negate out-of-range value " - + OUString::number($2.uval))); - YYERROR; + if ($2.uval == SAL_CONST_UINT64(0x8000000000000000)) { + $$ = unoidl::detail::SourceProviderExpr::Int(SAL_MIN_INT64); + } else { + if ($2.uval > SAL_MAX_INT64) { + error( + @2, yyscanner, + ("cannot negate out-of-range value " + + OUString::number($2.uval))); + YYERROR; + } + $$ = unoidl::detail::SourceProviderExpr::Int( + -static_cast<sal_Int64>($2.uval)); } - $$ = unoidl::detail::SourceProviderExpr::Int( - -static_cast<sal_Int64>($2.uval)); break; case unoidl::detail::SourceProviderExpr::TYPE_FLOAT: $$ = unoidl::detail::SourceProviderExpr::Float(-$2.fval); |