summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-compiler/core
diff options
context:
space:
mode:
Diffstat (limited to 'mrbgems/mruby-compiler/core')
-rw-r--r--mrbgems/mruby-compiler/core/parse.y3
-rw-r--r--mrbgems/mruby-compiler/core/y.tab.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/mrbgems/mruby-compiler/core/parse.y b/mrbgems/mruby-compiler/core/parse.y
index 1a97b3ec6..1a07cc14b 100644
--- a/mrbgems/mruby-compiler/core/parse.y
+++ b/mrbgems/mruby-compiler/core/parse.y
@@ -1450,7 +1450,7 @@ heredoc_end(parser_state *p)
%token <nd> tSTRING tSTRING_PART tSTRING_MID
%token <nd> tNTH_REF tBACK_REF
%token <num> tREGEXP_END
-%token <num> tNUMPARAM "numbered paraemeter"
+%token <num> tNUMPARAM "numbered parameter"
%type <nd> singleton string string_fragment string_rep string_interp xstring regexp
%type <nd> literal numeric cpath symbol defn_head defs_head
@@ -4682,6 +4682,7 @@ heredoc_remove_indent(parser_state *p, parser_heredoc_info *hinf)
start = 0;
while (start < len) {
end = escaped ? (size_t)escaped->car : len;
+ if (end > len) end = len;
spaces = (size_t)nspaces->car;
size_t esclen = end - start;
heredoc_count_indent(hinf, str + start, esclen, spaces, &offset);
diff --git a/mrbgems/mruby-compiler/core/y.tab.c b/mrbgems/mruby-compiler/core/y.tab.c
index 6c7940a7b..3e5c6e116 100644
--- a/mrbgems/mruby-compiler/core/y.tab.c
+++ b/mrbgems/mruby-compiler/core/y.tab.c
@@ -16,7 +16,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>. */
+ along with this program. If not, see <https://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
@@ -2085,7 +2085,7 @@ static const char *const yytname[] =
"\"constant\"", "\"class variable\"", "\"label\"", "\"integer literal\"",
"\"float literal\"", "\"character literal\"", "tXSTRING", "tREGEXP",
"tSTRING", "tSTRING_PART", "tSTRING_MID", "tNTH_REF", "tBACK_REF",
- "tREGEXP_END", "\"numbered paraemeter\"", "\"unary plus\"",
+ "tREGEXP_END", "\"numbered parameter\"", "\"unary plus\"",
"\"unary minus\"", "\"<=>\"", "\"==\"", "\"===\"", "\"!=\"", "\">=\"",
"\"<=\"", "\"&&\"", "\"||\"", "\"=~\"", "\"!~\"", "\"..\"", "\"...\"",
"tBDOT2", "tBDOT3", "tAREF", "tASET", "\"<<\"", "\">>\"", "\"::\"",
@@ -10718,6 +10718,7 @@ heredoc_remove_indent(parser_state *p, parser_heredoc_info *hinf)
start = 0;
while (start < len) {
end = escaped ? (size_t)escaped->car : len;
+ if (end > len) end = len;
spaces = (size_t)nspaces->car;
size_t esclen = end - start;
heredoc_count_indent(hinf, str + start, esclen, spaces, &offset);