Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[core]:

* Fix bugs in 'clone' method of fixedfloatarray.pmc, as mentioned
  in RT#45249.


git-svn-id: https://svn.parrot.org/parrot/trunk@21182 d31e2699-5ff4-0310-a27c-f18f2fbe73fe
  • Loading branch information...
commit cc7c3b2eb21d52d77b9777fe3d3dd0225e0c221c 1 parent dc124a2
@pmichaud pmichaud authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 src/pmc/fixedfloatarray.pmc
View
5 src/pmc/fixedfloatarray.pmc
@@ -89,16 +89,17 @@ Creates and returns a copy of the array.
PMC *clone() {
INTVAL size;
+ size_t mem_size;
PMC *dest = pmc_new(INTERP, SELF->vtable->base_type);
- size_t mem_size = size * sizeof (FLOATVAL);
if (!PMC_data(SELF))
return dest;
size = PMC_int_val(SELF);
PMC_int_val(dest) = size;
- PMC_data(dest) = mem_sys_allocate(mem_size);
+ mem_size = size * sizeof (FLOATVAL);
+ PMC_data(dest) = mem_sys_allocate(mem_size);
mem_sys_memcopy(PMC_data(dest), PMC_data(SELF), mem_size);
PObj_active_destroy_SET(dest);
Please sign in to comment.
Something went wrong with that request. Please try again.