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

GitHub noreply at github.com
Mon Nov 10 16:13:48 UTC 2014


  Branch: refs/heads/smoke-me/array-splice-gh766+1126+1127
  Home:   https://github.com/parrot/parrot
  Commit: cc28c94662a2e48a844afce0ada4e0c9a0c5a45b
      https://github.com/parrot/parrot/commit/cc28c94662a2e48a844afce0ada4e0c9a0c5a45b
  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: e6dd153884d769eddf9e6214909e36c0836aa793
      https://github.com/parrot/parrot/commit/e6dd153884d769eddf9e6214909e36c0836aa793
  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: 589364a286782bbb4b8fb67671facb78afec765c
      https://github.com/parrot/parrot/commit/589364a286782bbb4b8fb67671facb78afec765c
  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: affc05c294f334db18b1675896a63ba00f1877fa
      https://github.com/parrot/parrot/commit/affc05c294f334db18b1675896a63ba00f1877fa
  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: 76a60f2c222fb4f427a7a5452df7cf0eff21dba8
      https://github.com/parrot/parrot/commit/76a60f2c222fb4f427a7a5452df7cf0eff21dba8
  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: 6a4992eb782d36d32e4dcf20224a4606705e3da0
      https://github.com/parrot/parrot/commit/6a4992eb782d36d32e4dcf20224a4606705e3da0
  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/0289e098dee6...6a4992eb782d


More information about the parrot-commits mailing list