|  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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
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-2024 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 15:01:28 2024 UTC