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

Fix Z(6,3) segfaulting, and incorrect spelling of "finfield.c" #1029

Merged
merged 2 commits into from
Dec 21, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions src/finfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,10 @@ Obj FuncZ2 ( Obj self, Obj p, Obj d)
{
/* get the finite field */
ff = FiniteField( ip, id );


if (ff == 0)
ErrorMayQuit("Z: <q> must be a positive prime power", 0, 0);

/* make the root */
return NEW_FFE( ff, (ip == 2 && id == 1 ? 1 : 2) );
}
Expand All @@ -1953,7 +1956,7 @@ Obj FuncZ2 ( Obj self, Obj p, Obj d)
static StructGVarFilt GVarFilts [] = {

{ "IS_FFE", "obj", &IsFFEFilt,
FuncIS_FFE, "src/finifield.c:IS_FFE" },
FuncIS_FFE, "src/finfield.c:IS_FFE" },

{ 0 }

Expand All @@ -1967,19 +1970,19 @@ static StructGVarFilt GVarFilts [] = {
static StructGVarFunc GVarFuncs [] = {

{ "CHAR_FFE_DEFAULT", 1, "z",
FuncCHAR_FFE_DEFAULT, "src/finifield.c:CHAR_FFE_DEFAULT" },
FuncCHAR_FFE_DEFAULT, "src/finfield.c:CHAR_FFE_DEFAULT" },

{ "DEGREE_FFE_DEFAULT", 1, "z",
FunDEGREE_FFE_DEFAULT, "src/finifield.c:DEGREE_FFE_DEFAULT" },
FunDEGREE_FFE_DEFAULT, "src/finfield.c:DEGREE_FFE_DEFAULT" },

{ "LOG_FFE_DEFAULT", 2, "z, root",
FuncLOG_FFE_DEFAULT, "src/finifield.c:LOG_FFE_DEFAULT" },
FuncLOG_FFE_DEFAULT, "src/finfield.c:LOG_FFE_DEFAULT" },

{ "INT_FFE_DEFAULT", 1, "z",
FuncINT_FFE_DEFAULT, "src/finifield.c:INT_FFE_DEFAULT" },
FuncINT_FFE_DEFAULT, "src/finfield.c:INT_FFE_DEFAULT" },

{ "Z", 1, "q",
FuncZ, "src/finifield.c:Z" },
FuncZ, "src/finfield.c:Z" },

{ 0 }

Expand Down Expand Up @@ -2008,7 +2011,7 @@ static Int InitKernel (
InitGlobalBag( &SuccFF, "src/finfield.c:SuccFF" );
InitGlobalBag( &TypeFF, "src/finfield.c:TypeFF" );
InitGlobalBag( &TypeFF0, "src/finfield.c:TypeFF0" );
InitGlobalBag( &IntFF, "src/finifield.c:IntFF" );
InitGlobalBag( &IntFF, "src/finfield.c:IntFF" );

/* install the functions that handle overflow */
ImportFuncFromLibrary( "SUM_FFE_LARGE", &SUM_FFE_LARGE );
Expand Down
4 changes: 4 additions & 0 deletions tst/teststandard/bugfix.tst
Original file line number Diff line number Diff line change
Expand Up @@ -3152,6 +3152,10 @@ gap> Length(oe.vectors); Length(oe.solutions);
159
0

# 2016/12/20 (MH)
gap> Z(6,3);
Error, Z: <q> must be a positive prime power

#############################################################################
gap> STOP_TEST( "bugfix.tst", 831990000);

Expand Down