Commit Graph

39735 Commits

Author SHA1 Message Date
Matthew Flatt
2c09b2c86d cs: unbreak ffi/unsafe immobile cells 2019-03-02 11:02:00 -07:00
Matthew Flatt
068cfc6330 cs: unbreak Makefile for non-cross build 2019-03-02 06:42:40 -07:00
Matthew Flatt
c890edeea4 json: fix checking of word boundary after true, false, and null
Thanks to Greg Hendershott for pointing out the problem.
2019-03-02 05:38:06 -07:00
Matthew Flatt
33a5c30073 first step of Racket CS cross-compilation for Windows
Adjust build process to be able to generate Racket.exe, etc, for
Racket CS using MinGW. Much of this cross-compilation support can work
for building other platforms, too, but some of the details are filled
in only for generating Windows executables.
2019-03-02 05:33:26 -07:00
Paulo Matos
961454e011 Show cache contents for debugging purposes 2019-03-01 17:15:32 -05:00
Matthew Flatt
472ac6c26e tcp-connect: repair for error on connect syscall
When `connect` returns an error immediately, save that error instead
of expecting it to be available later via `getsockopt`. That avoids a
problem on TrueOS, for example.
2019-03-01 14:42:23 -07:00
Sam Tobin-Hochstadt
108b5fa3dd Add examples with booleans to comparison functions
Thanks to @ubsan for the report of trouble finding this information.
2019-02-28 16:45:53 -05:00
Paulo Matos
975324bd2f Use cached llvm to run scan-build on racket
This change ensures that the scan-build jobs run on a different
machine dedicated to it and that the llvm build is cached so it is not
rebuilt each time it is needed.
2019-02-28 13:36:01 -05:00
Matthew Flatt
a80714aeee fix JIT-inlined unsafe-fl<, etc., for > 2 args and CGC
Some parts of the implementation used for comparison were omitted when
allocation operations are not supported (but comparisons don't
allocate). This problem was unconvered by running the "jitinline.rktl"
tests with RacketCGC.
2019-02-28 10:01:47 -07:00
Matthew Flatt
d238007cf8 fix JIT-inlined unsafe-flrandom
Relevant to racket/typed-racket#807
2019-02-28 09:24:54 -07:00
shhyou
e970a6194a In case', report binding info of else' in error 2019-02-27 18:47:31 -06:00
Matthew Flatt
68312e43bd ffi/com: fix argument checking in com-get-property
Closes #2470
2019-02-27 16:15:28 -07:00
Matthew Flatt
0fefd6936a raco exe: fix problem with submodules
A recent revision to the way modules are instantiated for handling
runtime paths did not work right for modules from source (i.e., no
bytecode available) that have submodules.

Closes #2486
2019-02-27 15:31:06 -07:00
Ben Greenman
acb7be83d5
doc: the match pattern 'else' binds a variable (#2505)
In the guide & reference, explain that `match` treats `else` like any other variable and say how this is different from how `cond` and `case` treat the default `else` identifier.

This commit is inspired by two mailing list discussions:

- https://groups.google.com/d/msg/racket-users/hqXX_GL2Vlo/c6mT7W0_BwAJ
- https://lists.racket-lang.org/dev/archive/2013-May/012240.html
2019-02-27 10:33:42 -05:00
Matthew Flatt
f80c71e642 expander: handle strange local-expand under begin-for-syntax
Avoids internal errors (including unsafe behavior) in an example like

```
  #lang racket

  (begin-for-syntax
    (local-expand
     #'(#%plain-module-begin
        (begin-for-syntax
          (define x 42)))
     'module-begin
     '()))

  (begin-for-syntax
    (println x))
```

This example is weird, because it creates an `x` binding that doesn't
survive to the full expansion. Before the repair, the disappearing
binding created trouble for the expanded-to-linklet pass.

The example is weird for a second reason, which is that it uses uses
`local-expand` in a place where it will be triggered by visiting the
module. It turns out that raising a syntax error at that time (from
`#%plain-module-begin`) did not work correctly due to lazy
instantiation of the expansion context.

Closes #2458
2019-02-25 15:25:22 -07:00
Matthew Flatt
84837f4330 fix struct/c and struct/dc for new syntax arming of struct ids 2019-02-25 13:10:08 -07:00
Matthew Flatt
29d71e719b update a file test to work on Windows 2019-02-25 12:33:43 -07:00
Matthew Flatt
aa42163b70 fix place-channel handling of hash tables that contain impersonators
Closes #2504
2019-02-25 10:41:30 -07:00
Matthew Flatt
1c299e99db add some missing syntax-protects
Add `syntax-protect` to some macro expansions, especially macros in
contex where unsafe operations are imported, which means that a
combination of `local-expand` and `datum->syntaxa could provide access
to the unsafe bindings absent `syntax-protect`.
2019-02-25 07:48:04 -07:00
Matthew Flatt
685a1ff040 number-parsing repair for some inexact numbers
The fast path for inexact numbers didn't guard against underflow
correctly.
2019-02-25 07:48:04 -07:00
Matthew Flatt
078f697a0b JIT repair for eqv? on extflonums
Since `eqv?` recognizes extflonums, don't implement a comparsion to an
immediate extflonum as `eq?`.
2019-02-24 17:34:10 -07:00
Matthew Flatt
a3dfc1478a number-parsing repair for no-extflonum builds 2019-02-24 08:21:49 -07:00
Matthew Flatt
47a37f6bbe repair for number parsing
Fix a problem recognizing the range of characters for bases larger
than 10.
2019-02-23 21:09:16 -07:00
Matthew Flatt
0549bfb1e5 rewrite number parser
Inspired by the way the Chez Scheme number parser works, change the
one in the expander to be faster and probably clearer. This improved
performance brings number parsing almost back in line with the v6.12
parser's performance.

The revised parser is faster because it goes through an input string
just once. The new parser is also more xcomplete; it doesn't rely on a
host-system `number->string` (except for dummy extflonums when
extflonums are not supported).

If you're reading the commit history, beware that the note on commit
be19996953 is incorrect about the change to parsing divide-by-zero
errors. (It explains a change that was edited away before merging.)
This commit really does change the bahvior, though, again as a better
match for v6.12. Specifically, "/0" (with no hashes) always triggers
divide-by-zero in an otherwise well-formed number, even if `#i` is
used.
2019-02-23 17:25:54 -07:00
Matthew Flatt
be828b184c json: speed up JSON parser
Speed up JSON parsing (usually around x4 to x8) by avoiding regexp
matching and using more direct byte and character operations. Along
similar lines, compute parsed numbers directly instead of converting
to a string and then using `string->number`.

The revised reader behaves differently only in the case of a bad input
stream, where it may consume more bytes from the stream than the old
one due to eagerly reading bytes instead of tentatively matching
peeked bytes. Also, a UTF-8 decoding error is just `exn:fail` like
other input-parsing errors, and not `exn:fail:contract`.
2019-02-22 19:22:53 -07:00
Matthew Flatt
4d43c9884c io: fix file-buffer performance when driven by peeks 2019-02-22 18:47:08 -07:00
Matthew Flatt
75c8c3ce37 fix bytes-utf-8-ref to accept 5 arguments as documented 2019-02-22 18:46:36 -07:00
Matthew Flatt
c4a23595b9 json: faster parsing
Replace some regexœp operations with more direct `peek-char` and
read-char` operations.
2019-02-22 13:06:49 -07:00
Paulo Matos
fe945fe1dc Mark cs tests as allowing failure for Gitlab
This is a temporary measure in order to avoid Gitlab marking commits as failing. This is a known issue.
2019-02-22 11:35:33 -07:00
Paulo Matos
38f518a7aa Define MZ_DECLARE_NORETURN to use noreturn attribute
This helps the static analyzer understand which functions don't
return, and therefore improves the static analysis results greatly.
2019-02-22 11:35:08 -07:00
Jesse Alama
1eafd1518e Offer 7.2 in .travis.yml
Bring the boilerplate .travis.yml up-to-date.
2019-02-22 11:34:39 -07:00
Paulo Matos
7a6536ab6d Remove unnecessary exit(0);
This was necessary to avoid warnings in a specific compiler but after
adding MZ_DECLARE_NORETURN, this is now unnecessary.
2019-02-22 08:52:09 -07:00
Paulo Matos
ef8b31b527 Use noreturn attribute only when MZ_DECLARE_NORETURN 2019-02-22 08:52:09 -07:00
Paulo Matos
5b837b895f Put all declarations with NORETURN in a single line
If declarations are not in a single line makex.rkt gets confused and
mis-parses the declarations.
2019-02-22 08:52:09 -07:00
Paulo Matos
0659e51b3f Mark other error functions as NORETURN
Related to PR #2472, marks a few other functions as NORETURN.
Namely:
	- scheme_signal_error
	- scheme_wrong_count
	- scheme_wrong_count_m
	- scheme_case_lambda_wrong_count
	- scheme_wrong_type
	- scheme_wrong_contract
	- scheme_wrong_field_type
	- scheme_wrong_field_contract
	- scheme_arg_mismatch
	- scheme_contract_error
	- scheme_wrong_return_arity
	- scheme_unbound_global

Unfortunately static analysis is done per compilation unit, so
although, for example, scheme_wrong_contract calls scheme_raise_exn
and the latter is already marked NORETURN, the analyzer does not know
this. Therefore we need to manually propagate the NORETURN for each
function declaration.
2019-02-22 08:52:09 -07:00
Matthew Flatt
b7654d9a84 cs: avoid uninitialized bytevectors via ffi/unsafe
Zeroing out allocated memory is required by the specification of
`alloc` from `ffi/unsafe`.

Possibly relevant to #2493
2019-02-21 08:39:06 -07:00
Matthew Flatt
858a925c16 remove another dead assignment to buf, which also causes leak
These leaks happen just once in startup code, so they
didn't matter in practice --- but, obviously, its better to
fix them.
2019-02-20 16:35:27 -07:00
Matthew Flatt
a119804827 remove unused call to GC_set
Closes #2339
2019-02-20 16:35:27 -07:00
Matthew Flatt
6a94ce5c04 fix error-message typo 2019-02-20 16:35:27 -07:00
Paulo Matos
6fa0e4fc64 Avoid dead initialization of boot_offset
Assuming here that ELF_FIND_BOOT_SECTION and WIN32 are mutually exclusive.
2019-02-20 16:35:19 -07:00
Philip McGrath
fe563735be ffi/unsafe/alloc: handle keyword arguments
closes https://github.com/racket/racket/issues/2484
2019-02-20 16:29:28 -07:00
Paulo Matos
be054f6149 free buf to avoid memory leak 2019-02-20 16:27:58 -07:00
Paulo Matos
f75c641bb8 Fix typo in ffi docs 2019-02-20 16:26:14 -07:00
Paulo Matos
490105ed53 Remove dead store for rator 2019-02-20 16:25:38 -07:00
Paulo Matos
10d721eaea Remove dead store for did_alt 2019-02-20 16:24:45 -07:00
Paulo Matos
7e856b3b4d Remove dead assignment to buf which also causes leak 2019-02-20 16:23:30 -07:00
Paulo Matos
671611e992 Remove dead store for closure_size 2019-02-20 16:22:24 -07:00
Ben Greenman
6bd54d24a4
typo: 'by precede it'
Closes #2499
2019-02-20 12:17:15 -05:00
Ryan Culpepper
d185257a75
add unsafe-poll-fd, unsafe-fd->evt (#2414)
The unsafe-fd->evt interface is based on unsafe-{file-descriptor,socket}->semaphore. 
The main differences are that these events are level-triggered, not edge-triggered, and 
they do not cooperate with ports created by unsafe-{file-descriptor,socket}->port.
2019-02-20 13:53:11 +01:00
Ryan Culpepper
abb1ce71cc update expr/c, wrap-expr/c tests for contract message change 2019-02-19 15:09:51 +01:00