Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generic wrapping function raises SIGSEGV at src/common.c:206 #49

Closed
hiyuh opened this issue Feb 25, 2014 · 1 comment
Closed

generic wrapping function raises SIGSEGV at src/common.c:206 #49

hiyuh opened this issue Feb 25, 2014 · 1 comment

Comments

@hiyuh
Copy link
Contributor

hiyuh commented Feb 25, 2014

sometimes generics will be wrapped into appropriated constants in their architecture.

w/ proposed regression issueA,

entity issueA is
    generic (
        L : integer range 0 to integer'high
    );
begin
end entity issueA;

architecture a of issueA is
    pure function fL (
        iDUMMY : boolean
    ) return integer is
    begin
        if (L < 1) then
            return 1;
        else
            return L;
        end if;
    end function fL;
    constant cL : integer range 1 to integer'high := fL(true);
begin
end architecture a;

then i got,

$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src ./src/nvc.exe -a test/regress/issueA.vhd
Segmentation fault (core dumped)

$ NVC_LIBPATH=./lib/std:./lib/ieee:./lib/nvc NVC_CYG_LIB=./src gdb ./src/nvc.exe
[SNIP]
(gdb) r -a test/regress/issueA.vhd
Starting program: /home/hiyuh/git-repos/nvc/src/nvc.exe -a test/regress/issueA.vhd
[New Thread 6996.0x1aac]
[New Thread 6996.0x1624]

Program received signal SIGSEGV, Segmentation fault.
0x00450b86 in folded_bool (t=t@entry=0x800c4dd8, b=b@entry=0x0) at common.c:206
206              *b = (tree_pos(decl) == 1);
(gdb) bt
#0  0x00450b86 in folded_bool (t=t@entry=0x800c4dd8, b=b@entry=0x0) at common.c:206
#1  0x0045ad5e in folded (t=0x800c4dd8) at eval.c:157
#2  0x0045b67a in eval_fcall (t=t@entry=0x800c4e78, v=v@entry=0x28a960) at eval.c:385
#3  0x0045cd76 in eval (fcall=0x800c4e78) at eval.c:670
#4  0x004314fc in simp_fcall (t=t@entry=0x800c4e78) at simp.c:94
#5  0x00433dad in simp_tree (t=0x800c4e78, context=0x0) at simp.c:748
#6  0x0043c091 in tree_rewrite_aux (t=0x800c4e78, ctx=ctx@entry=0x28aafc) at tree.c:1814
#7  0x0043c1f6 in tree_rewrite_aux (t=0x800c4ef0, ctx=ctx@entry=0x28aafc) at tree.c:1771
#8  0x0043bf55 in tree_rewrite_aux (t=t@entry=0x800c4f38, ctx=ctx@entry=0x28aafc) at tree.c:1776
#9  0x0043c31d in tree_rewrite (t=t@entry=0x800c4f38, fn=fn@entry=0x433bc0 <simp_tree>, context=context@entry=0x0)
    at tree.c:1836
#10 0x00433f1d in simplify (top=0x800c4f38) at simp.c:786
#11 0x00401951 in analyse (argc=argc@entry=2, argv=0x28ac00) at nvc.c:120
#12 0x004ab40d in main (argc=2, argv=<optimized out>) at nvc.c:713
[SNIP]
@nickg
Copy link
Owner

nickg commented Mar 1, 2014

Fixed by the above

@nickg nickg closed this as completed Mar 1, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants