Commit graph

2288 commits

Author SHA1 Message Date
Alex Shinn
6d94e9b04c Adding Alexei Lozovsky to AUTHORS. 2015-04-15 17:20:31 +09:00
Alex Shinn
01df2fec44 Merge pull request #251 from ilammy/overflow-fixes
Fixed a couple of integer overflows
2015-04-15 17:14:58 +09:00
Alex Shinn
b6bbc1cae5 Enabling chicken snow installs, and adding to tests.
Smarter handling of requested vs. available impl installs.
2015-04-15 15:19:44 +09:00
Alex Shinn
4267164e92 Interleave reading/writing to subprocess in process-pipe-bytevector,
using u8-ready? to avoid blocking.  Fixes issue #253.
2015-04-15 11:24:56 +09:00
Alex Shinn
aa3f869798 Avoiding potential segfault from trying to capture temporary local variables in a macro.
Fixes issue #252.
2015-04-14 23:22:48 +09:00
Alex Shinn
579fcf95ae Fixing kawa install rules and adding to tests. 2015-04-11 01:21:38 +09:00
Alex Shinn
d1537fec79 Fixing library rewriting and test-depends bug. 2015-04-11 01:01:07 +09:00
Alex Shinn
2af0685012 Adding cross-implementation installation tests. 2015-04-09 11:05:33 +09:00
Alex Shinn
c9a9fc0070 Noting some simple char-set utilities are public domain. 2015-04-09 01:43:17 +09:00
Alex Shinn
ab966b3a85 Adding ray tracer benchmark. 2015-04-09 01:38:53 +09:00
Alex Shinn
66de0af938 Adding -R support to chibi bash completion. 2015-04-09 01:31:36 +09:00
Alex Shinn
e6ae585d1b Adding a gitignore for the temp data dir. 2015-04-09 01:30:06 +09:00
Alex Shinn
4dda923081 Updating copyright years. 2015-04-09 01:28:02 +09:00
Alex Shinn
9998a5619c Adding Marc to AUTHORS. 2015-04-09 01:25:26 +09:00
Alex Shinn
cef5f2facf Clarifying default language. 2015-04-09 01:24:07 +09:00
Alex Shinn
14c8776c40 Updating some completed items. 2015-04-09 01:22:52 +09:00
Alex Shinn
3979e98aa6 Adding initial snow command-line tests. 2015-04-09 01:16:52 +09:00
Alex Shinn
30453bdb32 Fixing snow tests requiring file renaming.
Adding support for test dependencies.
Allowing testing from a local repository.
Adding a snow index command.
Various bugfixes and config improvements.
2015-04-09 01:14:14 +09:00
Alex Shinn
f63ed5497e Ignoring generated files from snow tests. 2015-04-09 01:10:01 +09:00
Alex Shinn
55329e39fb Making uri-resolve work with bare local paths. 2015-04-08 23:04:48 +09:00
Alex Shinn
4e5cdedc03 Converting tests to modules instead of separate programs.
By convention, a library meant for testing exports "run-tests".
Also by convention, assume the test for (foo bar) is (foo bar-test),
keeping the test in the same directory and avoiding confusion since
(chibi test) is not a test for (chibi).
- Avoids the hack of "load"ing test, with resulting namespace complications.
- Allows keeping tests together with the libraries.
- Allows setting up test hooks before running.
- Allows implicit inference of test locations when using above conventions.
2015-04-05 23:38:51 +09:00
Alex Shinn
f4f954fe35 Fixing snow-chibi install source path after removing submodule. 2015-04-05 08:15:07 +09:00
Alex Shinn
71dc6ef42f Flattening submodule. 2015-04-04 23:16:31 +09:00
Alex Shinn
f52a13524c Removing submodule. 2015-04-04 23:14:31 +09:00
Alex Shinn
59a4e56df5 Fixing error messages for unknown options. 2015-04-03 14:11:33 +09:00
Alex Shinn
443dd1bc3f Adding process->output+error+status. 2015-04-03 07:13:33 +09:00
ilammy
8329ee9fd6 Do not lose carry bit in addition edge case
Previous code was losing the carry bit in 'all ones' case, when adata[i]
= bdata[i] = SEXP_UINT_T_MAX, and carry = 1 too. In this case expression
(SEXP_UINT_T_MAX - bdata[i] - carry) overflows and yields an incorrect
value SEXP_UINT_T_MAX which results into carry being incorrectly set to
0 after addition.

We need to avoid the second overflow when calculating the new value of
the carry bit. One way to do this is at first check for the overflow in
(adata[i] + bdata[i]), and then throw in the (previous) carry bit.

I have also given "n" more expressive name and added a comment about
the reason why we need that temporary variable.
2015-03-26 02:30:48 +02:00
ilammy
a1ec8ff493 Avoid overflow when doing sexp_fx_abs()
Naturally, fixed-width integer arithmetics can overflow. Chibi handles
it pretty well in general, but one case was missing: it is negation of
the minimal negative number that can be represented as a fixnum. That is,
sexp_fx_neg() must not be applied to sexp_make_fixnum(SEXP_MIN_FIXNUM)
because it overflows and returns an identical fixnum back.

sexp_fx_neg() itself seems to be used right in the current code, but
sexp_fx_abs()--which is defined in terms of sexp_fx_neg()--could be
applied to the forbidden number when used to retrieve an unboxed value
via the sexp_unbox_fixnum(sexp_fx_abs(x)) pattern. So I have added a
separate macro that safely calculates unboxed absolute value of a fixnum,
and replaced sexp_unbox_fixnum(sexp_fx_abs(x)) usages with it.

Current implementation uses two-bit tag for fixnums, plus we need one
bit for the sign, so fixnums have (machine word - 3) significant bits.
Regression tests cover word sizes of 16, 32, 64, and 128 bits (for the
sake of past- and future-proofness).

sexp_bignum_expt() does not have a regression test because we need to
check it with negative exponents like -2^29, so the base must be over
at least 2^(2^29) for the differences to be visible. Fun fact: bignum
representation of such number takes around 1/32 of the available user-
space memory, which makes testing on anything except 32-bit systems
unreasonable (4 TB of RAM anyone?)
2015-03-26 02:30:48 +02:00
Alex Shinn
3700b86470 Updating submodule. 2015-03-22 23:17:14 +09:00
Alex Shinn
d08ce6e925 regexp-search can terminate early if a match is found and all remaining possible matches start to the right of it 2015-03-22 22:45:36 +09:00
Alex Shinn
87761001aa Adding (time [<name>] <expr>) macro for easy benchmarking. 2015-03-22 22:44:38 +09:00
Alex Shinn
9dcf11056c Updating submodule. 2015-03-22 17:16:58 +09:00
Alex Shinn
11d9e1114e Ignoring generated tarballs. 2015-03-22 17:15:25 +09:00
Alex Shinn
6c08d399e7 changes go to the 0.7.3 release 2015-03-22 17:02:41 +09:00
Alex Shinn
ce7ab08e1e Updating submodule. 2015-03-22 16:17:53 +09:00
Alex Shinn
2576183b48 Updating submodule. 2015-03-22 16:06:08 +09:00
Alex Shinn
f95153f6c1 Adding .gitignore. 2015-03-17 22:50:40 +09:00
Alex Shinn
b22e81afd6 fixing install target for snow-chibi 2015-03-17 22:09:32 +09:00
Alex Shinn
62c0dd1ede removed snow-chibi tool moved to submodule 2015-03-17 22:06:10 +09:00
Alex Shinn
dba883c687 added submodule for removed chibi-snow 2015-03-17 21:53:47 +09:00
Alex Shinn
96e3c8f06f removing lib/chibi/snow dir to make it a submodule 2015-03-17 21:52:09 +09:00
Alex Shinn
3000523427 Bugfix in hash-table-copy which didn't copy hash function.
Patch from Alexei Lozovsky.
2015-03-13 07:10:41 +09:00
Alex Shinn
2db64f67f8 Fixing typo in r7rs-tests.
Was testing be-like-begin1 twice instead of be-like-begin2.
2015-03-12 22:39:43 +09:00
Alex Shinn
7b8af8725d Better C++ genstatic support. 2015-03-06 17:48:11 +09:00
Alex Shinn
9b3529b0e6 Hacky C++ fixes. 2015-03-06 17:43:23 +09:00
Alex Shinn
214a1aaf78 C++ FFI fixes. 2015-03-06 17:41:29 +09:00
Alex Shinn
64c148c9ce C++ fixes. 2015-03-06 17:35:06 +09:00
Alex Shinn
c16f36ceee Fixing typo in non-chibi regexp code.
The second %char-set:punctuation should have been %char-set:symbol.
2015-03-03 08:17:13 +09:00
Alex Shinn
217a231064 Fixing typo in emscripten code.
Fixes issue #248.
2015-03-03 08:15:57 +09:00
Alex Shinn
447eb20a07 Disabling 2010 epoch by default. 2015-03-03 00:40:02 +09:00