Skip to content

Commit b6c1770

Browse files
committed
Fixed exceptions raising
1 parent 0482773 commit b6c1770

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/common/DecFloat.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class DecimalContext : public decContext
6262
init(DEC_INIT_DECIMAL128);
6363
}
6464

65-
~DecimalContext()
65+
~DecimalContext() noexcept(false)
6666
{
6767
// Typically excptions should better be not thrown from destructors.
6868
// But in our case there should never be any exception raised inside
@@ -82,10 +82,11 @@ class DecimalContext : public decContext
8282
{
8383
if (mask & unmaskedExceptions)
8484
{
85-
decContextRestoreStatus(this, mask, ~0);
85+
decContextSetStatusQuiet(this, mask);
8686
const char* statusString = decContextStatusToString(this);
87-
(Arg::Gds(isc_random) << "DecFloat error" <<
88-
Arg::Gds(isc_random) << statusString).raise();
87+
decContextSetStatusQuiet(this, 0);
88+
(Arg::Gds(isc_random) << "Decimal float error" <<
89+
Arg::Gds(isc_random) << statusString).raise();
8990
}
9091
}
9192
}

0 commit comments

Comments
 (0)