aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--eval.c4
-rw-r--r--misc/ruby-mode.el21
3 files changed, 24 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 6c8c2d7741..110c4fe640 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,9 @@ Fri Oct 29 11:35:04 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
Fri Oct 29 10:00:30 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (rb_thread_start_0): forget to free some memory chunks.
+ [ruby-core:03611]
+
* eval.c (ruby_cleanup): ruby_finalize_1 may cause exception,
should be wrapped by PUSH_TAG/POP_TAG(). [ruby-dev:24627]
diff --git a/eval.c b/eval.c
index 1f9d9375dd..a8df3ebd1b 100644
--- a/eval.c
+++ b/eval.c
@@ -11473,6 +11473,10 @@ rb_thread_start_0(fn, arg, th)
if (th == main_thread) ruby_stop(state);
rb_thread_remove(th);
+ if (saved_block) {
+ blk_free(saved_block);
+ }
+
if (state && status != THREAD_TO_KILL && !NIL_P(ruby_errinfo)) {
th->flags |= THREAD_RAISED;
if (state == TAG_FATAL) {
diff --git a/misc/ruby-mode.el b/misc/ruby-mode.el
index 462ec609be..041ddc66ff 100644
--- a/misc/ruby-mode.el
+++ b/misc/ruby-mode.el
@@ -521,10 +521,23 @@ The variable ruby-indent-level controls the amount of indentation.
(looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\sw+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
- (if (re-search-forward (concat "^" re "$") end 'move)
- (forward-line 1)
- (setq in-string (match-end 0))
- (goto-char end)))
+ (let* ((id-end (goto-char (match-end 0)))
+ (line-end-position (save-excursion (end-of-line) (point)))
+ (state (list in-string nest depth pcol indent)))
+ ;; parse the rest of the line
+ (while (and (> line-end-position (point))
+ (setq state (apply 'ruby-parse-partial
+ line-end-position state))))
+ (setq in-string (car state)
+ nest (nth 1 state)
+ depth (nth 2 state)
+ pcol (nth 3 state)
+ indent (nth 4 state))
+ ;; skip heredoc section
+ (if (re-search-forward (concat "^" re "$") end 'move)
+ (forward-line 1)
+ (setq in-string id-end)
+ (goto-char end))))
(t
(goto-char pnt))))
((looking-at "^__END__$")