diff --git a/src/fn_strings.cpp b/src/fn_strings.cpp index f8f055e2a..79805d782 100644 --- a/src/fn_strings.cpp +++ b/src/fn_strings.cpp @@ -166,6 +166,11 @@ namespace Sass { String_Constant* s = ARG("$string", String_Constant); double start_at = ARGVAL("$start-at"); double end_at = ARGVAL("$end-at"); + + if (start_at != (int)start_at) { + error("$start-at: " + std::to_string(start_at) + " is not an int", pstate, traces); + } + String_Quoted* ss = Cast(s); std::string str(s->value()); @@ -176,6 +181,10 @@ namespace Sass { end_at = -1; } + if (end_at != (int)end_at) { + error("$end-at: " + std::to_string(end_at) + " is not an int", pstate, traces); + } + if (end_at == 0 || (end_at + size) < 0) { if (ss && ss->quote_mark()) newstr = quote(""); return SASS_MEMORY_NEW(String_Quoted, pstate, newstr);