annotate test/bug-61191/bug-61191.tst @ 30199:37ddca7ad9cb stable

avoid internal error and segfault with eval and scripts (bug #61191) * stack-frame.cc (script_stack_frame::get_val_offsets_with_insert): If frame_offset is initially zero then update frame_offset from m_lexical_frame_offsets after calling set_script_offsets_internal. * test/bug-61191/bug-61191.tst, test/bug-61191/subdir/bug_61191.m: New files. * test/bug-61191/module.mk: Update. * test/module.mk: Update.
author John W. Eaton <jwe@octave.org>
date Tue, 21 Sep 2021 13:14:31 -0400
parents
children 49c8538c64c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30199
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 ########################################################################
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3 ## Copyright (C) 2021 The Octave Project Developers
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 ## See the file COPYRIGHT.md in the top-level directory of this
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
6 ## distribution or <https://octave.org/copyright/>.
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
7 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 ## This file is part of Octave.
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 ## Octave is free software: you can redistribute it and/or modify it
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 ## under the terms of the GNU General Public License as published by
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
12 ## the Free Software Foundation, either version 3 of the License, or
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ## (at your option) any later version.
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 ## Octave is distributed in the hope that it will be useful, but
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16 ## WITHOUT ANY WARRANTY; without even the implied warranty of
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 ## GNU General Public License for more details.
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 ## You should have received a copy of the GNU General Public License
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 ## along with Octave; see the file COPYING. If not, see
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 ## <https://www.gnu.org/licenses/>.
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23 ##
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 ########################################################################
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
26 %!test <61191>
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 %! unwind_protect
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
28 %! addpath ("subdir");
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 %! omc_1 = rand (3, 1);
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
30 %! Tc_1 = rand (3, 1);
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 %! bug_61191
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32 %! assert (omckk, omc_1);
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 %! assert (Tckk, Tc_1);
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 %! unwind_protect_cleanup
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 %! rmpath ("subdir");
37ddca7ad9cb avoid internal error and segfault with eval and scripts (bug #61191)
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 %! end_unwind_protect