[ClavaLaraApi] Fixes bug with MemoiGen always trying to build a DMT
@@ -413,6 +413,7 @@ MemoiGen.prototype._generateGeneric = function(wrapperName, report) {
var $function = chain["function"];
var $call = chain["call"];
+ if(report !== undefined) {
// build the DMT and test the apply policy
var dmt = MemoiCodeGen.generateDmt(this._tableSize, report, this._applyPolicy);
if(!dmt.testPolicy()){
@@ -420,6 +421,9 @@ MemoiGen.prototype._generateGeneric = function(wrapperName, report) {
println(this._target._sig + "[" + report.callSites[0] + "]" + " fails the apply policy " + this._applyPolicy + ". Not applying memoization.");
return;
}
+ } else {
+ var dmt = undefined;
+ }
if(this._isDebug) {
var totalName = wrapperName + '_total_calls';
