From 9d130722d6147550c407a5baabe78b0a75489a96 Mon Sep 17 00:00:00 2001 From: Justin Ethier Date: Tue, 7 Sep 2021 08:24:08 -0400 Subject: [PATCH] Do not inline calls to `system` --- CHANGELOG.md | 1 + scheme/cyclone/cps-optimizations.sld | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e624ec1c..1fcb6fb3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ Features Bug Fixes - Do not display error message for missing file(s) if SCM->C compilation fails. +- Do not inline calls to `system` as it could result in multiple calls of the same command. ## 0.32.0 - August 16, 2021 diff --git a/scheme/cyclone/cps-optimizations.sld b/scheme/cyclone/cps-optimizations.sld index 8b5eca9f..c79b6f20 100644 --- a/scheme/cyclone/cps-optimizations.sld +++ b/scheme/cyclone/cps-optimizations.sld @@ -1057,7 +1057,8 @@ (lambda (arg) (and (prim-call? arg) ;; Do not inline functions that are looping over lists, seems counter-productive - (not (member (car arg) '( member assoc Cyc-fast-member Cyc-fast-assoc assq assv memq memv))) + ;; Or functions that may be harmful to call more than once such as system + (not (member (car arg) '( member assoc Cyc-fast-member Cyc-fast-assoc assq assv memq memv system))) (not (prim:cont? (car arg))))) (cdr exp)) ;; Disallow primitives that allocate a new obj,