Print this page
11506 smatch resync

@@ -17,10 +17,12 @@
 
 #include "smatch.h"
 #include "smatch_extra.h"
 
 static int my_id;
+extern int second_half_id;
+extern void set_spectre_first_half(struct expression *expr);
 
 static int suppress_multiple = 1;
 
 static int is_write(struct expression *expr)
 {

@@ -163,12 +165,14 @@
                 return;
         if (is_harmless(expr))
                 return;
 
         array_expr = get_array_base(expr);
-        if (suppress_multiple && is_ignored_expr(my_id, array_expr))
+        if (suppress_multiple && is_ignored_expr(my_id, array_expr)) {
+                set_spectre_first_half(expr);
                 return;
+        }
 
         offset = get_array_offset(expr);
         if (!is_user_rl(offset))
                 return;
         if (is_nospec(offset))

@@ -190,10 +194,12 @@
         name = expr_to_str(array_expr);
         sm_warning("potential spectre issue '%s' [%s]%s",
                name,
                is_read(expr) ? "r" : "w",
                conditions ? " (local cap)" : "");
+
+        set_spectre_first_half(expr);
         if (suppress_multiple)
                 add_ignore_expr(my_id, array_expr);
         free_string(name);
 }