Skip to content

Fix PrecLimit not restored on exception#405

Merged
tompng merged 1 commit intoruby:masterfrom
tompng:exception_restore_limit
Aug 20, 2025
Merged

Fix PrecLimit not restored on exception#405
tompng merged 1 commit intoruby:masterfrom
tompng:exception_restore_limit

Conversation

@tompng
Copy link
Member

@tompng tompng commented Aug 20, 2025

Fixes #404

The scope of changing PrecLimit was large.

pl = VpSetPrecLimit(0);
// Doing many operations here
VpSetPrecLimit(pl);

If an exception occurs, PrecLimit won't be restored correctly.

Also fixes this performance issue

BigDecimal('1e9999999999').add(1, 10)
processing time: 1.831897s  0.000162s
=> 0.1e10000000000

@tompng tompng force-pushed the exception_restore_limit branch 3 times, most recently from d429dcb to 065e0b5 Compare August 20, 2025 16:32
The scope of changing PrecLimit was large. If an exception occurs while chaginc PrecLimit, PrecLimit won't be restored correctly.
@tompng tompng force-pushed the exception_restore_limit branch from 065e0b5 to 2dfd3b4 Compare August 20, 2025 16:40
@tompng tompng merged commit 1854328 into ruby:master Aug 20, 2025
79 checks passed
@tompng tompng deleted the exception_restore_limit branch August 20, 2025 16:45
@tompng tompng added the bug label Aug 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PrecLimit not restored on exception

1 participant