Skip to content

Commit c5fb7cf

Browse files
author
matz
committed
1.3.8 to be, final beta (hopefully)
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent b0faee9 commit c5fb7cf

29 files changed

+309
-178
lines changed

ChangeLog

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,48 @@
1+
Wed Aug 11 10:10:02 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
2+
3+
* parse.y (yylex): parse `[].length==0' as `([].length)==0', not
4+
`([].length=)=0'
5+
6+
* parse.y (yylex): parse `[].length!=0' as `([].length)!=0', not
7+
`([].length!)=0'
8+
9+
* parse.y (peek): peek-in lexical buffer.
10+
11+
Wed Aug 11 00:34:05 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
12+
13+
* regex.c (re_match): bug on backward jump adjustment concerning
14+
stop_paren.
15+
16+
Tue Aug 10 14:54:25 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
17+
18+
* ext/nkf/nkf.c (rb_nkf_guess): binary detection was wrong.
19+
20+
Tue Aug 10 00:07:36 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
21+
22+
* io.c (rb_io_clone): should use CLONESETUP().
23+
24+
Mon Aug 9 23:57:07 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
25+
26+
* ruby.h (CLONESETUP): should have copied generic instance
27+
variables too.
28+
29+
Mon Aug 9 10:46:54 1999 Katsuyuki Komatsu <komatsu@sarion.co.jp>
30+
31+
* ext/socket/extconf.rb: add check for <arpa/nameser.h> and
32+
<resolv.h>.
33+
34+
Sat Aug 7 13:19:06 1999 EGUCHI Osamu <eguchi@shizuokanet.ne.jp>
35+
36+
* numeric.c (flo_cmp): comparing NaN should not return value.
37+
raises FloatDomainError.
38+
39+
Sat Aug 7 03:09:08 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
40+
41+
* eval.c (blk_free): free copied frames too.
42+
43+
* eval.c (frame_dup): should copy previous frames from stack to
44+
heap to preserve frame information.
45+
146
Fri Aug 6 15:01:07 1999 Yukihiro Matsumoto <matz@netlab.co.jp>
247

348
* version 1.3.7 - version 1.4 beta
@@ -2420,7 +2465,6 @@ Fri Sep 4 11:27:40 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
24202465

24212466
* regex.c (re_search): wrong return value for \A.
24222467

2423-
>>>>>>> 1.1.1.2.2.154
24242468
Thu Sep 3 14:08:14 1998 Yukihiro Matsumoto <matz@netlab.co.jp>
24252469

24262470
* version 1.1c4 released.

ToDo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
Language Spec.
22

3+
* compile time string concatenation, "hello" "world" => "helloworld"
34
* ../... outside condition invokes operator method too.
45
* %w(a\ b\ c abc) => ["a b c", "abc"]
56
* package or access control for global variables
67
* class variable (prefix?)
78
* named arguments like foo(nation:="german") or foo(nation: "german").
89
* method to retrieve argument information (need new C API)
9-
* multiple return values, yield values. maybe incompatible
10+
* multiple return values, yield values. maybe incompatible ???
1011
* cascading method invocation ???
1112
* def Class#method .. end ??
1213
* class Foo::Bar<Baz .. end, module Boo::Bar .. end
@@ -24,6 +25,7 @@ Hacking Interpreter
2425

2526
Standard Libraries
2627

28+
* Struct::new([name,]member,...) ??
2729
* String#scanf(?)
2830
* Object#fmt(?)
2931
* Time::strptime

array.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ rb_ary_new2(len)
8686
ary->len = 0;
8787
ary->capa = len;
8888
ary->ptr = 0;
89+
if (len == 0) len++;
8990
ary->ptr = ALLOC_N(VALUE, len);
9091

9192
return (VALUE)ary;

configure

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4056,7 +4056,7 @@ echo "configure:4028: checking whether OS depend dynamic link works" >&5
40564056
LDFLAGS="-Wl,-E"
40574057
rb_cv_dlopen=yes;;
40584058
solaris*) if test "$GCC" = yes; then
4059-
LDSHARED='gcc -Wl,-G'
4059+
LDSHARED='$(CC) -Wl,-G'
40604060
`$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null && LDFLAGS="-Wl,-E"
40614061
else
40624062
LDSHARED='ld -G'
@@ -4070,11 +4070,11 @@ echo "configure:4028: checking whether OS depend dynamic link works" >&5
40704070
rb_cv_dlopen=yes;;
40714071
esix*|uxpds*) LDSHARED="ld -G"
40724072
rb_cv_dlopen=yes ;;
4073-
osf*) LDSHARED="gcc -shared"
4073+
osf*) LDSHARED="$CC -shared"
40744074
rb_cv_dlopen=yes ;;
4075-
linux*) LDSHARED="gcc -shared"
4075+
linux*) LDSHARED="$CC -shared"
40764076
rb_cv_dlopen=yes ;;
4077-
freebsd*) LDSHARED="gcc -shared"
4077+
freebsd*) LDSHARED="$CC -shared"
40784078
if test -x /usr/bin/objformat && \
40794079
test `/usr/bin/objformat` = "elf" ; then
40804080
LDFLAGS="-rdynamic"

configure.bat

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ if errorlevel 0 goto not_seen
1414
:not_seen
1515
sed -f top.sed < Makefile.in > Makefile
1616
sed -f top.sed < ext\extmk.rb.in > ext\extmk.rb
17-
copy ext\Setup.dj ext\Setup
1817
copy config_h.dj config.h
1918
if not (%OS%) == (Windows_NT) goto LFN
2019
copy missing\vsnprintf.c missing\vsnprint.c

configure.in

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ if test "$with_dln_a_out" != yes; then
400400
LDFLAGS="-Wl,-E"
401401
rb_cv_dlopen=yes;;
402402
solaris*) if test "$GCC" = yes; then
403-
LDSHARED='gcc -Wl,-G'
403+
LDSHARED='$(CC) -Wl,-G'
404404
`$CC --print-prog-name=ld` -v 2>&1 | grep "GNU ld" > /dev/null && LDFLAGS="-Wl,-E"
405405
else
406406
LDSHARED='ld -G'
@@ -414,11 +414,11 @@ if test "$with_dln_a_out" != yes; then
414414
rb_cv_dlopen=yes;;
415415
esix*|uxpds*) LDSHARED="ld -G"
416416
rb_cv_dlopen=yes ;;
417-
osf*) LDSHARED="gcc -shared"
417+
osf*) LDSHARED="$CC -shared"
418418
rb_cv_dlopen=yes ;;
419-
linux*) LDSHARED="gcc -shared"
419+
linux*) LDSHARED="$CC -shared"
420420
rb_cv_dlopen=yes ;;
421-
freebsd*) LDSHARED="gcc -shared"
421+
freebsd*) LDSHARED="$CC -shared"
422422
if test -x /usr/bin/objformat && \
423423
test `/usr/bin/objformat` = "elf" ; then
424424
LDFLAGS="-rdynamic"

eval.c

Lines changed: 51 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,7 @@ static struct SCOPE *top_scope;
404404
_frame.iter = ruby_iter->iter; \
405405
_frame.cbase = ruby_frame->cbase; \
406406
_frame.argc = 0; \
407+
_frame.argv = 0; \
407408
ruby_frame = &_frame; \
408409

409410
#define POP_FRAME() \
@@ -2212,7 +2213,10 @@ rb_eval(self, node)
22122213

22132214
case NODE_SCOPE:
22142215
{
2215-
VALUE save = ruby_frame->cbase;
2216+
struct FRAME frame = *ruby_frame;
2217+
2218+
frame.tmp = ruby_frame;
2219+
ruby_frame = &frame;
22162220

22172221
PUSH_SCOPE();
22182222
PUSH_TAG(PROT_NONE);
@@ -2233,7 +2237,7 @@ rb_eval(self, node)
22332237
}
22342238
POP_TAG();
22352239
POP_SCOPE();
2236-
ruby_frame->cbase = save;
2240+
ruby_frame = frame.tmp;
22372241
if (state) JUMP_TAG(state);
22382242
}
22392243
break;
@@ -2847,12 +2851,15 @@ module_setup(module, node)
28472851
NODE * volatile node;
28482852
{
28492853
int state;
2850-
VALUE save = ruby_frame->cbase;
2854+
struct FRAME frame = *ruby_frame;
28512855
VALUE result; /* OK */
28522856
char *file = ruby_sourcefile;
28532857
int line = ruby_sourceline;
28542858
TMP_PROTECT;
28552859

2860+
frame.tmp = ruby_frame;
2861+
ruby_frame = &frame;
2862+
28562863
/* fill c-ref */
28572864
node->nd_clss = module;
28582865
node = node->nd_body;
@@ -2888,7 +2895,7 @@ module_setup(module, node)
28882895
POP_SCOPE();
28892896
POP_CLASS();
28902897

2891-
ruby_frame->cbase = save;
2898+
ruby_frame = frame.tmp;
28922899
if (trace_func) {
28932900
call_trace_func("end", file, line, 0, ruby_frame->last_func, 0);
28942901
}
@@ -4199,7 +4206,6 @@ eval(self, src, scope, file, line)
41994206
struct BLOCK * volatile old_block;
42004207
struct RVarmap * volatile old_d_vars;
42014208
int volatile old_vmode;
4202-
struct FRAME * volatile old_frame;
42034209
struct FRAME frame;
42044210
char *filesave = ruby_sourcefile;
42054211
int linesave = ruby_sourceline;
@@ -4221,7 +4227,6 @@ eval(self, src, scope, file, line)
42214227
/* PUSH BLOCK from data */
42224228
frame = data->frame;
42234229
frame.tmp = ruby_frame; /* gc protection */
4224-
old_frame = ruby_frame;
42254230
ruby_frame = &(frame);
42264231
old_scope = ruby_scope;
42274232
ruby_scope = data->scope;
@@ -4259,7 +4264,7 @@ eval(self, src, scope, file, line)
42594264
POP_CLASS();
42604265
ruby_in_eval--;
42614266
if (!NIL_P(scope)) {
4262-
ruby_frame = old_frame;
4267+
ruby_frame = frame.tmp;
42634268
if (FL_TEST(ruby_scope, SCOPE_DONT_RECYCLE))
42644269
FL_SET(old_scope, SCOPE_DONT_RECYCLE);
42654270
ruby_scope = old_scope;
@@ -5324,10 +5329,20 @@ static void
53245329
blk_free(data)
53255330
struct BLOCK *data;
53265331
{
5327-
struct BLOCK *tmp;
5332+
struct FRAME *frame;
5333+
void *tmp;
53285334

5335+
frame = data->frame.prev;
5336+
while (frame) {
5337+
if (frame->argc > 0)
5338+
free(frame->argv);
5339+
tmp = frame;
5340+
frame = frame->prev;
5341+
free(tmp);
5342+
}
53295343
while (data) {
5330-
free(data->frame.argv);
5344+
if (data->frame.argc > 0)
5345+
free(data->frame.argv);
53315346
tmp = data;
53325347
data = data->prev;
53335348
free(tmp);
@@ -5343,14 +5358,36 @@ blk_copy_prev(block)
53435358
while (block->prev) {
53445359
tmp = ALLOC_N(struct BLOCK, 1);
53455360
MEMCPY(tmp, block->prev, struct BLOCK, 1);
5346-
tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc);
5361+
if (tmp->frame.argc > 0) {
5362+
tmp->frame.argv = ALLOC_N(VALUE, tmp->frame.argc);
5363+
MEMCPY(tmp->frame.argv, block->frame.argv, VALUE, tmp->frame.argc);
5364+
}
53475365
scope_dup(tmp->scope);
5348-
MEMCPY(tmp->frame.argv, block->frame.argv, VALUE, tmp->frame.argc);
53495366
block->prev = tmp;
53505367
block = tmp;
53515368
}
53525369
}
53535370

5371+
static void
5372+
frame_dup(frame)
5373+
struct FRAME *frame;
5374+
{
5375+
VALUE *argv;
5376+
struct FRAME *tmp;
5377+
5378+
for (;;) {
5379+
if (frame->argc > 0) {
5380+
argv = ALLOC_N(VALUE, frame->argc);
5381+
MEMCPY(argv, frame->argv, VALUE, frame->argc);
5382+
frame->argv = argv;
5383+
}
5384+
if (!frame->prev) break;
5385+
tmp = ALLOC(struct FRAME);
5386+
*tmp = *frame->prev;
5387+
frame->prev = tmp;
5388+
frame = tmp;
5389+
}
5390+
}
53545391

53555392
static VALUE
53565393
bind_clone(self)
@@ -5363,8 +5400,7 @@ bind_clone(self)
53635400
bind = Data_Make_Struct(rb_cBinding,struct BLOCK,blk_mark,blk_free,data);
53645401
CLONESETUP(bind,self);
53655402
MEMCPY(data, orig, struct BLOCK, 1);
5366-
data->frame.argv = ALLOC_N(VALUE, orig->frame.argc);
5367-
MEMCPY(data->frame.argv, orig->frame.argv, VALUE, orig->frame.argc);
5403+
frame_dup(&data->frame);
53685404

53695405
if (data->iter) {
53705406
blk_copy_prev(data);
@@ -5389,11 +5425,10 @@ rb_f_binding(self)
53895425

53905426
data->orig_thread = rb_thread_current();
53915427
data->iter = rb_f_iterator_p();
5428+
frame_dup(&data->frame);
53925429
if (ruby_frame->prev) {
53935430
data->frame.last_func = ruby_frame->prev->last_func;
53945431
}
5395-
data->frame.argv = ALLOC_N(VALUE, data->frame.argc);
5396-
MEMCPY(data->frame.argv, ruby_block->frame.argv, VALUE, data->frame.argc);
53975432

53985433
if (data->iter) {
53995434
blk_copy_prev(data);
@@ -5467,8 +5502,7 @@ proc_s_new(klass)
54675502

54685503
data->orig_thread = rb_thread_current();
54695504
data->iter = data->prev?Qtrue:Qfalse;
5470-
data->frame.argv = ALLOC_N(VALUE, data->frame.argc);
5471-
MEMCPY(data->frame.argv, ruby_block->frame.argv, VALUE, data->frame.argc);
5505+
frame_dup(&data->frame);
54725506
if (data->iter) {
54735507
blk_copy_prev(data);
54745508
}

ext/Setup.nt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
option nodynamic
1+
#option nodynamic
22

33
#GD
44
Win32API

ext/extmk.rb.in

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ end
1717
SRC_EXT = ["c", "cc", "m", "cxx", "cpp", "C"]
1818
$extlist = []
1919

20+
$includedir = "@includedir@".gsub(/\$\{prefix\}|\$\(prefix\)/,'@prefix@')
21+
2022
$cache_mod = false
2123
$lib_cache = {}
2224
$func_cache = {}
@@ -67,8 +69,8 @@ if RUBY_PLATFORM == "m68k-human"
6769
else
6870
CFLAGS = "@CFLAGS@"
6971
end
70-
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I@includedir@ @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
71-
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I@includedir@ %s %s conftest.c"
72+
LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
73+
CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s conftest.c"
7274

7375
if /cygwin|mswin32|djgpp|mingw32|m68k-human|i386-os2_emx/i =~ RUBY_PLATFORM
7476
$null = open("nul", "w")
@@ -80,6 +82,7 @@ $orgerr = $stderr.dup
8082
$orgout = $stdout.dup
8183
def xsystem command
8284
if $DEBUG
85+
puts command
8386
return system(command)
8487
end
8588
$stderr.reopen($null)
@@ -378,7 +381,7 @@ def create_makefile(target)
378381
if "@DLEXT@" == $OBJEXT
379382
libs = $libs.split
380383
for lib in libs
381-
lib.sub!(/-l(.*)/, '"lib\1.#{$LIBEXT}"')
384+
lib.sub!(/-l(.*)/, %%"lib\\1.#{$LIBEXT}"%)
382385
end
383386
$defs.push(format("-DEXTLIB='%s'", libs.join(",")))
384387
end
@@ -687,7 +690,10 @@ if $cache_mod
687690
f.close
688691
end
689692

690-
exit if $install or $clean
693+
if $install or $clean
694+
Dir.chdir ".."
695+
exit
696+
end
691697
$extinit = "" unless $extinit
692698

693699
ruby = "@RUBY_INSTALL_NAME@@EXEEXT@"

ext/fcntl/fcntl.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pack up your own arguments to pass as args for locking functions, etc.
3434
#include "ruby.h"
3535
#include <fcntl.h>
3636

37+
void
3738
Init_fcntl()
3839
{
3940
VALUE mFcntl = rb_define_module("Fcntl");

ext/nkf/nkf.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,9 @@ rb_nkf_guess(obj, src)
133133
if (*p == '\033') {
134134
return INT2FIX(_JIS);
135135
}
136-
if ('\000' < *p && *p < '\006'
136+
if ('\000' <= *p && *p < '\006'
137137
|| *p == 0x7f
138-
|| *p == 0xdf) {
138+
|| *p == 0xff) {
139139
return INT2FIX(_BINARY);
140140
}
141141
if (0x81 <= *p && *p <= 0x8d) {

0 commit comments

Comments
 (0)