File tree Expand file tree Collapse file tree 5 files changed +36
-5
lines changed Expand file tree Collapse file tree 5 files changed +36
-5
lines changed Original file line number Diff line number Diff line change
1
+ Tue Aug 15 17:30:59 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
2
+
3
+ * eval.c (frame_dup): should set flag FRAME_MALLOC after
4
+ argv allocation.
5
+
6
+ * eval.c (blk_free): should not free argv if GC was called before
7
+ frame_dup.
8
+
9
+ Tue Aug 15 01:45:28 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
10
+
11
+ * io.c (argf_eof): should return true at the end of ARGF without
12
+ checking stdout if arguments are given.
13
+
14
+ Mon Aug 14 10:34:32 2000 Yukihiro Matsumoto <matz@ruby-lang.org>
15
+
16
+ * eval.c (rb_thread_status): status should return false for normal
17
+ termination, nil for termination by exception.
18
+
1
19
Wed Aug 9 13:24:25 2000 WATANABE Hirofumi <eban@os.rim.or.jp>
2
20
3
21
* win32/win32.[ch]: emulate rename(2).
Original file line number Diff line number Diff line change @@ -22,10 +22,14 @@ extern struct FRAME {
22
22
char * file ;
23
23
int line ;
24
24
int iter ;
25
+ int flags ;
25
26
} * ruby_frame ;
26
27
27
28
void rb_gc_mark_frame _ ((struct FRAME * ) );
28
29
30
+ #define FRAME_ALLOCA 0
31
+ #define FRAME_MALLOC 1
32
+
29
33
extern struct SCOPE {
30
34
struct RBasic super ;
31
35
ID * local_tbl ;
Original file line number Diff line number Diff line change @@ -429,6 +429,7 @@ static struct SCOPE *top_scope;
429
429
_frame.cbase = ruby_frame->cbase; \
430
430
_frame.argc = 0; \
431
431
_frame.argv = 0; \
432
+ _frame.flags = FRAME_ALLOCA; \
432
433
ruby_frame = &_frame; \
433
434
434
435
#define POP_FRAME () \
@@ -5488,7 +5489,7 @@ blk_free(data)
5488
5489
5489
5490
frame = data -> frame .prev ;
5490
5491
while (frame ) {
5491
- if (frame -> argc > 0 )
5492
+ if (frame -> argc > 0 && ( frame -> flags & FRAME_MALLOC ) )
5492
5493
free (frame -> argv );
5493
5494
tmp = frame ;
5494
5495
frame = frame -> prev ;
@@ -5534,6 +5535,7 @@ frame_dup(frame)
5534
5535
argv = ALLOC_N (VALUE , frame -> argc );
5535
5536
MEMCPY (argv , frame -> argv , VALUE , frame -> argc );
5536
5537
frame -> argv = argv ;
5538
+ frame -> flags = FRAME_MALLOC ;
5537
5539
}
5538
5540
frame -> tmp = 0 ; /* should not preserve tmp */
5539
5541
if (!frame -> prev ) break ;
@@ -7259,9 +7261,9 @@ rb_thread_status(thread)
7259
7261
rb_thread_t th = rb_thread_check (thread );
7260
7262
7261
7263
if (rb_thread_dead (th )) {
7262
- if (NIL_P (th -> errinfo ) && (th -> flags & THREAD_RAISED ))
7263
- return Qfalse ;
7264
- return Qnil ;
7264
+ if (! NIL_P (th -> errinfo ) && (th -> flags & THREAD_RAISED ))
7265
+ return Qnil ;
7266
+ return Qfalse ;
7265
7267
}
7266
7268
7267
7269
return Qtrue ;
Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ struct timeval rb_time_interval _((VALUE));
98
98
99
99
static VALUE filename , current_file ;
100
100
static int gets_lineno ;
101
- static int init_p = 0 , next_p = 0 ;
101
+ static int init_p = 0 , next_p = 0 , first_p = 1 ;
102
102
static VALUE lineno ;
103
103
104
104
#ifdef _STDIO_USES_IOSTREAM /* GNU libc */
@@ -2274,6 +2274,7 @@ next_argv()
2274
2274
current_file = rb_stdin ;
2275
2275
}
2276
2276
init_p = 1 ;
2277
+ first_p = 0 ;
2277
2278
gets_lineno = 0 ;
2278
2279
}
2279
2280
@@ -3084,8 +3085,13 @@ argf_readchar()
3084
3085
static VALUE
3085
3086
argf_eof ()
3086
3087
{
3088
+ int first = first_p ;
3089
+
3087
3090
if (init_p == 0 && !next_argv ())
3088
3091
return Qtrue ;
3092
+ if (!first && next_p == -1 ) {
3093
+ return Qtrue ;
3094
+ }
3089
3095
if (TYPE (current_file ) != T_FILE ) {
3090
3096
return argf_forward ();
3091
3097
}
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ def transfercmd(cmd)
203
203
raise FTPReplyError , resp
204
204
end
205
205
conn = sock . accept
206
+ sock . close
206
207
end
207
208
return conn
208
209
end
You can’t perform that action at this time.
0 commit comments