From 83a4e40c59dd99ff3131cbdb57b24b456aa04b93 Mon Sep 17 00:00:00 2001
From: Hans Schoenemann <hannes@mathematik.uni-kl.de>
Date: Tue, 2 Apr 2024 15:09:51 +0200
Subject: [PATCH] countedref + https://github.com/Singular/Singular/issues/1212

diff --git a/Singular/countedref.cc b/Singular/countedref.cc
index d3b783ade7..f83d7fab62 100644
--- a/Singular/countedref.cc
+++ b/Singular/countedref.cc
@@ -108,7 +108,7 @@ class CountedRefData:
   BOOLEAN put(leftv res) { return broken() || m_data.put(res);  }
 
   /// Extract (shallow) copy of stored data
-  LeftvShallow operator*() const { return (broken()? LeftvShallow(): (const LeftvShallow&)m_data); }
+  LeftvShallow operator*() { return (broken()? LeftvShallow(): LeftvShallow(m_data)); }
 
   /// Determine active ring when ring dependency changes
   BOOLEAN rering() {
