[librsvg/librsvg-2.50] Drop temporary values earlier in SpecifiedValues::to_computed_values()



commit 7df443b8a64abd0cbba1a118100511f6651de73a
Author: Sebastian Dröge <sebastian centricular com>
Date:   Thu Feb 25 21:24:57 2021 +0200

    Drop temporary values earlier in SpecifiedValues::to_computed_values()
    
    The `prop_val` in each of the `compute!` expansions would previously
    only be dropped at the end of the function although it's only used
    inside the macro. To prevent that, add a new block inside the macro to
    have it dropped at the end of each macro expansion.
    
    Maybe fixes https://gitlab.gnome.org/GNOME/librsvg/-/issues/686

 rsvg_internals/src/properties.rs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/rsvg_internals/src/properties.rs b/rsvg_internals/src/properties.rs
index b2ad2245..b6e9324b 100644
--- a/rsvg_internals/src/properties.rs
+++ b/rsvg_internals/src/properties.rs
@@ -546,7 +546,7 @@ impl SpecifiedValues {
 
     pub fn to_computed_values(&self, computed: &mut ComputedValues) {
         macro_rules! compute {
-            ($name:ident, $field:ident) => {
+            ($name:ident, $field:ident) => {{
                 let prop_val = self.get_property(PropertyId::$name);
                 if let ParsedProperty::$name(s) = prop_val {
                     computed.set_value(ComputedValue::$name(
@@ -555,7 +555,7 @@ impl SpecifiedValues {
                 } else {
                     unreachable!();
                 }
-            };
+            }};
         }
 
         // First, compute font_size.  It needs to be done before everything


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]