diff src/evalfunc.c @ 19548:9a9ca0e622c8 v8.2.0331

patch 8.2.0331: internal error when using test_void() and test_unknown() Commit: https://github.com/vim/vim/commit/7c215c58936cbebd4132ad6112d04db54b7c153e Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 29 13:43:27 2020 +0100 patch 8.2.0331: internal error when using test_void() and test_unknown() Problem: Internal error when using test_void() and test_unknown(). (Dominique Pelle) Solution: Give a normal error.
author Bram Moolenaar <Bram@vim.org>
date Sat, 29 Feb 2020 13:45:04 +0100
parents 22f0dda71638
children b38d73f36467
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -1890,7 +1890,10 @@ f_empty(typval_T *argvars, typval_T *ret
 #endif
 	case VAR_UNKNOWN:
 	case VAR_VOID:
-	    internal_error("f_empty(UNKNOWN)");
+	    // Let's not use internal_error() here, otherwise
+	    // empty(test_unknown()) with ABORT_ON_INTERNAL_ERROR defined makes
+	    // Vim abort.
+	    semsg(_(e_intern2), "f_empty(UNKNOWN)");
 	    n = TRUE;
 	    break;
     }
@@ -8275,7 +8278,10 @@ f_type(typval_T *argvars, typval_T *rett
 	case VAR_BLOB:    n = VAR_TYPE_BLOB; break;
 	case VAR_UNKNOWN:
 	case VAR_VOID:
-	     internal_error("f_type(UNKNOWN)");
+	     // Let's not use internal_error() here, otherwise
+	     // empty(test_unknown()) with ABORT_ON_INTERNAL_ERROR defined
+	     // makes Vim abort.
+	     semsg(_(e_intern2), "f_type(UNKNOWN)");
 	     n = -1;
 	     break;
     }