You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 14, 2021. It is now read-only.
I've recently updated to dharma 1.3.1 for my fuzzing projects, and noticed that it couldn't generate correct code anymore. After investigation it turned out that recursive definition of variable now produces an incorrect output.
Here is a basic test case for reproduction:
Grammar dharma_regression.dg
%section% := value
UseOfVar :=
print(!var!);
%section% := variable
var :=
@var@ = new Foo();
@var@ = new FooFromVar(!var!);
%section% := variance
main :=
+UseOfVar+
On dharma 1.2, the !var! used in the second variable definition is correctly recursed over until no dependencies are needed, which produces a "correct" output such as:
$ dharma -grammars dharma_regression.dg
var1 = new Foo();
var2 = new FooFromVar(var1);
var3 = new FooFromVar(var2);
var4 = new FooFromVar(var3);
print(var3);
print(var4);
print(var4);
print(var1);
print(var3);
print(var1);
However, by upgrading dharma 1.3.1, the test cases generated look more like:
$ dharma -grammars dharma_regression.dg
var2 = new FooFromVar(var2);
var2 = new FooFromVar(var2);
var3 = new Foo();
print(var2);
print(var3);
Which will produce "used-before-assigned" type of errors once trying to be executed. After some quick check, it seems that the regression was introduced by 834203f. With that commit reverted, the variable recursion operates as expected.
Can you confirm this behavior?
Thank you.
The text was updated successfully, but these errors were encountered:
Hi,
First off, thank you for this awesome project.
I've recently updated to dharma 1.3.1 for my fuzzing projects, and noticed that it couldn't generate correct code anymore. After investigation it turned out that recursive definition of variable now produces an incorrect output.
Here is a basic test case for reproduction:
dharma_regression.dg
On dharma 1.2, the
!var!
used in the second variable definition is correctly recursed over until no dependencies are needed, which produces a "correct" output such as:However, by upgrading dharma 1.3.1, the test cases generated look more like:
Which will produce "used-before-assigned" type of errors once trying to be executed. After some quick check, it seems that the regression was introduced by 834203f. With that commit reverted, the variable recursion operates as expected.
Can you confirm this behavior?
Thank you.
The text was updated successfully, but these errors were encountered: