From efeb0e05b95bfbf005c0264a4eeab83a91a876f6 Mon Sep 17 00:00:00 2001
From: markus holzer <markus.holzer@fau.de>
Date: Wed, 3 Mar 2021 10:46:19 +0100
Subject: [PATCH] Added conditional for non type

---
 pystencils/cpu/cpujit.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/pystencils/cpu/cpujit.py b/pystencils/cpu/cpujit.py
index f42a27037..7486cf34e 100644
--- a/pystencils/cpu/cpujit.py
+++ b/pystencils/cpu/cpujit.py
@@ -375,9 +375,11 @@ def create_function_boilerplate_code(parameter_info, name, ast_node, insert_chec
                 np_dtype = field.dtype.numpy_dtype
                 item_size = np_dtype.itemsize
 
-                aligned = any([a.lhs.args[2] for a in ast_node.assignments
-                               if hasattr(a, 'lhs') and isinstance(a.lhs, cast_func)
-                               and hasattr(a.lhs, 'dtype') and isinstance(a.lhs.dtype, VectorType)])
+                aligned = False
+                if ast_node.assignments:
+                    aligned = any([a.lhs.args[2] for a in ast_node.assignments
+                                   if hasattr(a, 'lhs') and isinstance(a.lhs, cast_func)
+                                   and hasattr(a.lhs, 'dtype') and isinstance(a.lhs.dtype, VectorType)])
 
                 if ast_node.instruction_set and aligned:
                     byte_width = ast_node.instruction_set['width'] * item_size
-- 
GitLab