From: Michael Beck Date: Wed, 23 Jul 2008 15:10:26 +0000 (+0000) Subject: do NOT overwrite custom hash function X-Git-Url: http://nsz.repo.hu/git/?a=commitdiff_plain;h=aa1341dd4a881caa579aa161fe991190f1671302;p=libfirm do NOT overwrite custom hash function [r20630] --- diff --git a/ir/ir/iropt.c b/ir/ir/iropt.c index 907a8fe96..7603a490b 100644 --- a/ir/ir/iropt.c +++ b/ir/ir/iropt.c @@ -6205,11 +6205,15 @@ static ir_op_ops *firm_set_default_hash(ir_opcode code, ir_op_ops *ops) ops->hash = hash_##a; \ break + /* hash function already set */ + if (ops->hash != NULL) + return ops; + switch (code) { CASE(Const); CASE(SymConst); default: - /* use input/mode default hash */ + /* use input/mode default hash if no function was given */ ops->hash = firm_default_hash; }