|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #75164 split_bc_num() is pointless
Submitted: 2017-09-06 12:17 UTC Modified: 2017-09-18 13:25 UTC
From: Assigned: cmb (profile)
Status: Closed Package: BC math related
PHP Version: 7.0.23 OS: *
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Bug Type:
New email:
PHP Version: OS:


 [2017-09-06 12:17 UTC]
The fix for bug #72093 introduced split_bc_num(), but this
function appears to be pointless, because it returns its input if
the refcount is greater than or equal 1[1] (what' most likely
always true).

Even if the split would be done if the refcount is greater than 1,
it appears that the shallow copy[2] would not be sufficient
anyway, since bc_struct holds pointers to strings[3] which would
still be shared.

I have not been able to come up with a test case showing the
assumed misbehavior. Actually, all tests still pass (even with
valgrind enabled), if the function's body is changed to always
return num.

[1] <>
[2] <>
[3] <>


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-09-18 13:25 UTC]
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Wed Sep 22 18:03:35 2021 UTC