diff --git a/py/makeqstrdata.py b/py/makeqstrdata.py
index 2ec5a1fb69393261682c9b8f60a0ff2b4764a4d0..599b936f9e4870b95b0da5a48893676010221cba 100644
--- a/py/makeqstrdata.py
+++ b/py/makeqstrdata.py
@@ -27,7 +27,8 @@ def compute_hash(qstr):
     hash = 5381
     for char in qstr:
         hash = (hash * 33) ^ ord(char)
-    return hash & 0xffff
+    # Make sure that valid hash is never zero, zero means "hash not computed"
+    return (hash & 0xffff) or 1
 
 def do_work(infiles):
     # read the qstrs in from the input files