From bd2c69090111d5a33a5eed11395428279e9fc514 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Tue, 21 Nov 2017 16:08:00 +0100 Subject: [PATCH] intmap-remove returns empty-intmap if appropriate * module/language/cps/intmap.scm (intmap-remove): Return empty-intmap if the result is indeed empty. --- module/language/cps/intmap.scm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/module/language/cps/intmap.scm b/module/language/cps/intmap.scm index 3a4f51776..15b1b5372 100644 --- a/module/language/cps/intmap.scm +++ b/module/language/cps/intmap.scm @@ -1,5 +1,5 @@ ;;; Functional name maps -;;; Copyright (C) 2014, 2015 Free Software Foundation, Inc. +;;; Copyright (C) 2014, 2015, 2017 Free Software Foundation, Inc. ;;; ;;; This library is free software: you can redistribute it and/or modify ;;; it under the terms of the GNU Lesser General Public License as @@ -386,7 +386,9 @@ already, and always calls the meet procedure." (let ((root* (remove (- i min) shift root))) (if (eq? root root*) map - (make-intmap/prune min shift root*)))) + (if (absent? root*) + empty-intmap + (make-intmap/prune min shift root*))))) (else map))) (($ ) (intmap-remove (persistent-intmap map) i))))