[parrot/parrot] ec7e1a: [pmc] fix splice overflows with negative count

GitHub noreply at github.com
Mon Nov 10 12:44:59 UTC 2014


  Branch: refs/heads/smoke-me/array-splice-gh766+1126+1127
  Home:   https://github.com/parrot/parrot
  Commit: ec7e1ac62d0c7479331008cad155e99d5d97bd0f
      https://github.com/parrot/parrot/commit/ec7e1ac62d0c7479331008cad155e99d5d97bd0f
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/resizablepmcarray.pmc
    M src/pmc/resizablestringarray.pmc

  Log Message:
  -----------
  [pmc] fix splice overflows with negative count

Fixes GH #766.
Throw illegal argument with negative count arguments for now.

TODO: Implement support for negative count argument for splice.
Add more splice methods.


  Commit: d36da0fdde934df50d2501bf4bac134a3df46455
      https://github.com/parrot/parrot/commit/d36da0fdde934df50d2501bf4bac134a3df46455
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M src/hll.c
    M src/pmc/arrayiterator.pmc
    M src/pmc/bytebuffer.pmc
    M src/pmc/fixedbooleanarray.pmc
    M src/pmc/fixedfloatarray.pmc
    M src/pmc/fixedintegerarray.pmc
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/fixedstringarray.pmc
    M src/pmc/hashiterator.pmc
    M src/pmc/integer.pmc
    M src/pmc/mappedbytearray.pmc
    M src/pmc/packfileview.pmc
    M src/pmc/pmclist.pmc
    M src/pmc/resizablebooleanarray.pmc
    M src/pmc/resizablefloatarray.pmc
    M src/pmc/resizableintegerarray.pmc
    M src/pmc/resizablepmcarray.pmc
    M src/pmc/resizablestringarray.pmc
    M src/string/api.c
    M t/pmc/resizablepmcarray.t
    M t/stress/rpa-splice.t
    M t/tools/dev/headerizer/testlib/fixedbooleanarray_pmc.in

  Log Message:
  -----------
  [pmc] harmonize and combine out of bounds exception strings

use less static string memory. no special context.
Use only "illegal argument" for unsupported negative arguments.
GH #1126

* index out of bounds,
* illegal argument (for illegal negative args),
* can't resize (for fixed*pmcs or size=0 arguments)
* StopIteration


  Commit: 054781d977f33974310a3a0196b80af46dc4a918
      https://github.com/parrot/parrot/commit/054781d977f33974310a3a0196b80af46dc4a918
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M compilers/imcc/imcc.l
    M compilers/imcc/imclexer.c
    M src/events.c
    M src/gc/system.c
    M src/interp/api.c
    M src/io/api.c
    M src/nci/libffi.c
    M src/oo.c
    M src/ops/core.ops
    M src/ops/experimental.ops
    M src/packfile/api.c
    M src/packfile/object_serialization.c
    M src/packfile/output.c
    M src/packfile/segments.c
    M src/platform/darwin/sysmem.c
    M src/platform/generic/sysmem.c
    M src/platform/win32/entropy.c
    M src/platform/win32/exec.c
    M src/pmc.c
    M src/runcore/main.c
    M src/scheduler.c
    M src/string/encoding/ucs2.c
    M src/string/encoding/ucs4.c
    M src/string/encoding/utf16.c
    M src/string/encoding/utf8.c

  Log Message:
  -----------
  More error message harmonization  #1126

Do not end the exception string with ".", "!" or "\n".


  Commit: d079d16e113822d86a68b6ba32eafad5a778fa03
      https://github.com/parrot/parrot/commit/d079d16e113822d86a68b6ba32eafad5a778fa03
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M src/pmc/fixedbooleanarray.pmc
    M src/pmc/fixedfloatarray.pmc
    M src/pmc/fixedintegerarray.pmc
    M src/pmc/fixedpmcarray.pmc
    M src/pmc/fixedstringarray.pmc
    M src/pmc/resizablebooleanarray.pmc
    M src/pmc/resizablefloatarray.pmc
    M src/pmc/resizableintegerarray.pmc
    M t/pmc/resizablefloatarray.t

  Log Message:
  -----------
  [pmc] allow negative array key indices

Fixes GH #1127
currently we throw "index out of bounds" when getting or setting $P0[-1]
the added code is only:
  if (key < 0)
      key += size;
so it is hard to argue for performance reasons.
ditto for resizable*array for consistency if not already implemented.


  Commit: 3ca4d6486a904e5dc71c46a883d46f74cbd636ad
      https://github.com/parrot/parrot/commit/3ca4d6486a904e5dc71c46a883d46f74cbd636ad
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M t/op/exceptions.t
    M t/op/stringu.t
    M t/pmc/fixedbooleanarray.t
    M t/pmc/fixedfloatarray.t
    M t/pmc/fixedintegerarray.t
    M t/pmc/fixedpmcarray.t
    M t/pmc/fixedstringarray.t
    M t/pmc/integer.t
    M t/pmc/mappedbytearray.t
    M t/pmc/resizablefloatarray.t
    M t/pmc/resizableintegerarray.t
    M t/pmc/resizablepmcarray.t
    M t/src/extend_vtable.t
    M t/tools/pbc_disassemble.t

  Log Message:
  -----------
  [test] change array tests to new harmonized out of bounds exceptions


  Commit: dc140f13f269fb480fd5c54ada715cbef7fb5a97
      https://github.com/parrot/parrot/commit/dc140f13f269fb480fd5c54ada715cbef7fb5a97
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M t/stress/gc.t

  Log Message:
  -----------
  t/stress/gc.t doc


  Commit: 6839b09c6c8e51d011f7c48bcbefb9ec82bf092f
      https://github.com/parrot/parrot/commit/6839b09c6c8e51d011f7c48bcbefb9ec82bf092f
  Author: Reini Urban <rurban at cpanel.net>
  Date:   2014-11-10 (Mon, 10 Nov 2014)

  Changed paths:
    M ChangeLog

  Log Message:
  -----------
  ChangeLog for the 3 array changes


Compare: https://github.com/parrot/parrot/compare/ec7e1ac62d0c^...6839b09c6c8e


More information about the parrot-commits mailing list