From 48015d8a4f19019dad672ac2d65c6429ddcc4a52 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 6 May 2020 07:00:30 -0700 Subject: [PATCH] internal_power missing func seg fault --- search/Power.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/search/Power.cc b/search/Power.cc index a728af0e..9cf1e058 100644 --- a/search/Power.cc +++ b/search/Power.cc @@ -610,7 +610,7 @@ Power::findInputInternalPower(const Pin *pin, LibertyPort *out_port = findExprOutPort(when); if (out_port) { FuncExpr *func = out_port->function(); - if (func->hasPort(port)) + if (func && func->hasPort(port)) duty = evalActivityDifference(func, inst, port).duty(); else duty = evalActivity(when, inst).duty(); @@ -768,7 +768,7 @@ Power::findInputDuty(const Pin *to_pin, FuncExpr *when = pwr->when(); const Pin *from_pin = network_->findPin(inst, from_port); Vertex *from_vertex = graph_->pinLoadVertex(from_pin); - if (func->hasPort(from_port)) { + if (func && func->hasPort(from_port)) { PwrActivity from_activity = findActivity(from_pin); PwrActivity to_activity = findActivity(to_pin); float duty1 = evalActivityDifference(func, inst, from_port).duty();