Commit graph

73 commits

Author SHA1 Message Date
Alex Shinn
d3c2306220 check bignum type before deref in sexp_[su]int_value (issue #410) 2017-05-18 22:36:33 +09:00
Alex Shinn
383c6cba62 fixing off-by-one error in arithmetic-shift 2017-05-08 23:49:55 +09:00
VermillionAzure
b955dc2698 Arranged definitions to prevent double definition
- It is possible to define `strcasecmp` and
  `strncasecmp` twice if `__MINGW32__` is defined.
  However, the same definition is used if it's not.
  Therefore, I just moved it inside of the "if-defined"
  case. It removes the errors pertaining to that header.

- Additional compilation errors related to the filesystem
  implementation and POSIX definitions of constants still
  are brought up when compiling on Windows 10, MSYS2-mingw-w64
  with gcc.
2017-03-06 00:11:25 -10:00
Alex Shinn
e1d58eb84a adding SHUT_{RD,WR} from mkeeter 2017-02-20 22:14:15 +09:00
Alex Shinn
260f55adec Use a context global instead of a static C global for the default random source.
Fixes issue #385.
2017-01-20 00:49:11 +09:00
Alex Shinn
0fa1179c2f add -T option to disable TCO 2017-01-14 16:51:07 +09:00
Alex Shinn
0281c590f0 Don't use flexible array member syntax when compiling with C++.
Fixes issue #378.
2016-10-27 21:29:13 +09:00
Jasu
0bb88f97ed Remove a spurious semi-colon from the macro sexp_make_vector 2016-07-27 19:27:37 +03:00
Alex Shinn
c953f2ed1d Check the module search path to handle relocated shared libraries
when loading an image.  Fixes issue #345.
2016-06-15 22:50:30 +09:00
Alex Shinn
08494037ea making features a context global 2016-06-12 14:25:46 +09:00
Alex Shinn
bb636b9b83 PRIoff is also "%lld" for cygwin64 (issue #358) 2016-06-08 07:22:09 +09:00
Alex Shinn
ab3f3ad3a0 PRIoff is also "%lld" for Win64. Fixes issue #358. 2016-06-07 22:36:01 +09:00
Alex Shinn
8ac14b5f91 Fixing printing of x-0.0i (issue #352). 2016-06-06 22:18:47 +09:00
Alex Shinn
78e8a04dd6 Conditionally defining PRIoff for off_t printf.
Fixes issue #320.
2016-04-09 20:09:57 +09:00
Alex Shinn
0c80f38a19 making string-cursors a disjoint type 2016-03-29 22:25:09 +09:00
Alex Shinn
eed963381c allow loading images from offsets 2016-03-13 09:08:41 +09:00
Alex Shinn
524179388d making image save/load functions public 2016-03-08 23:13:16 +09:00
Alex Shinn
fb24b831b8 fix reading circular refs inside vectors 2016-03-04 23:41:16 +09:00
Alex Shinn
207ae1f24e making syntactic closure free variable handling agree with mit-scheme 2016-02-27 16:06:20 +09:00
Alex Shinn
11ad0c3e3d fixing boehm build, excluding image code when not used 2016-02-20 23:49:28 +09:00
Chris Walsh
2005c19ea0 Added full support for packed images, both for static and dynamic libraries. 2016-02-15 21:12:58 -05:00
Alex Shinn
2c2ff588df Smarter polling in blocked output without threads, enable polling in blocked input.
Fixes issue #295.
2015-12-30 14:07:50 +09:00
Frère Jérôme
2f19dc69b1 Exclude socket.h on Windows (unless using Cygwin) 2015-11-19 09:55:23 +01:00
Frère Jérôme
584f74dbd9 Handle missing strcasestr() in MinGW 2015-11-19 09:37:37 +01:00
Alex Shinn
830b016276 removing declarations for sexp_display, now implemented in scheme
Fixes issue #275.
2015-08-10 22:22:07 +09:00
Alex Shinn
1956e38ba0 adding set-syn type 2015-07-29 22:35:15 +09:00
Alex Shinn
bc262aa7ad adding support for reader labels in core reader 2015-07-06 23:18:33 +09:00
Alex Shinn
42c14af4b9 removing support for SEXP_USE_STRING_STREAMS 2015-07-04 23:25:40 +09:00
Alex Shinn
49505b4849 adding count to gc timer 2015-06-27 20:43:43 +09:00
Alex Shinn
3fe810c86a Fixing weak references. 2015-06-20 23:03:44 +09:00
Alex Shinn
f5326fafc3 adding heap-sizes to check distribution of chunk sizes in heap 2015-06-15 21:04:25 +09:00
Alex Shinn
950312f13b adding optional tracking of gc time 2015-06-14 23:03:19 +09:00
Alex Shinn
b4c7a7081d Don't bother resetting weak references if none have been allocated. 2015-06-14 16:58:48 +09:00
Alex Shinn
6db194171e Adding option to disable automatic running of finalizers altogether. 2015-06-14 16:19:55 +09:00
Alex Shinn
f0ee48fc4c Fixing type slot specifications. Report from ilammy in issue #235.
- SEXP_STACK had an off by one sexp_type_field_len_base past the top of stack
- SEXP_EXCEPTION claimed 6 slots but only 5 were present
- sexp_type_struct should have had "dl" slot at end
2015-06-03 21:42:57 +09:00
Alex Shinn
607d70c6a0 When directly incrementing or aligning bytecode pos during code generation,
ensure there is enough space just as when emitting.
2015-05-12 23:03:48 +09:00
Alex Shinn
24a880ad28 Adding fixed-size heaps as an experimental compile-time option. 2015-04-25 22:24:56 +09:00
Alex Shinn
11cb17835b Adding sexp_int32_t definition. Fixing SRFI 27 bug on 32 bit machines.
Fixing the random-integer range to allow all results with a bignum bound.
2015-04-25 13:01:16 +09:00
ilammy
a6ca2e39dc chibi.crypto: move sexp_uintN_t typedefs to <sexp.h>
First we check for C99 support in Makefile.detect, looking for the
header we need and verifying whether it is the right one by using
a definition required by C99 standard to be present in that header.

uintN_t types are optional, but implementations are required to
provide corresponding limit #defines for the types they support,
so we can check for this with preprocessor only.

Finally, we define SEXP_UINTN_DEFINED for any sexp_uintN_t we have
so that the code can use #ifs to check for exact integer support.
2015-04-19 16:01:11 +03: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
4dda923081 Updating copyright years. 2015-04-09 01:28:02 +09: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
447eb20a07 Disabling 2010 epoch by default. 2015-03-03 00:40:02 +09:00
Alex Shinn
692a231091 merge 2015-02-13 19:04:59 +09:00
Alex Shinn
ed4cef9294 Adding sexp_length macro. 2015-02-13 19:02:28 +09:00
Alex Shinn
05294de078 Committing removed files. 2015-02-08 16:02:50 +09:00
Alex Shinn
f54e40547d Adding an abort facility to exit the vm without any exception handling. 2015-02-05 22:09:45 +09:00
Alex Shinn
2922ed591d Forgot to install regexp (patch from Lorenzo) 2015-01-26 08:06:59 +09:00
Alex Shinn
f24eef289c Optimizing string-offset->index. 2015-01-24 12:46:44 +09:00
Alex Shinn
429704a5f6 thread-terminate should set an exception in the thread 2014-12-27 14:51:12 +09:00