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

GitHub noreply at github.com
Mon Nov 10 13:43:41 UTC 2014


  Branch: refs/heads/smoke-me/array-splice-gh766+1126+1127
  Home:   https://github.com/parrot/parrot
  Commit: f898fa5efb13b32a1c075110faabccf26cefe3b7
      https://github.com/parrot/parrot/commit/f898fa5efb13b32a1c075110faabccf26cefe3b7
  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: 7de5a35bacc9e3fb55f570b2f2ec2ee0d2ba314e
      https://github.com/parrot/parrot/commit/7de5a35bacc9e3fb55f570b2f2ec2ee0d2ba314e
  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: df59cb2df8a78e99045c861e53deb06cb273697b
      https://github.com/parrot/parrot/commit/df59cb2df8a78e99045c861e53deb06cb273697b
  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: dbaffa44098af4abd892462a4b92f8572cbea34f
      https://github.com/parrot/parrot/commit/dbaffa44098af4abd892462a4b92f8572cbea34f
  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: 73af982116bf7ccbfadf3b13c0d414d68eb80b5e
      https://github.com/parrot/parrot/commit/73af982116bf7ccbfadf3b13c0d414d68eb80b5e
  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: 0289e098dee6a2ff3f7829c0c54d614fdf9fb131
      https://github.com/parrot/parrot/commit/0289e098dee6a2ff3f7829c0c54d614fdf9fb131
  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/6839b09c6c8e...0289e098dee6


More information about the parrot-commits mailing list