Skip to content

Commit fdf168f

Browse files
committed
Fix an issue with implied multiplication in the contextFraction.pl macro.
The issue occurs with the following MWE: ``` DOCUMENT(); loadMacros(qw(PGstandard.pl MathObjects.pl contextUnits.pl contextFraction.pl)); Context(context::Units::extending('Fraction')->withUnitsFor('length')); $a = Compute('2*3 cm'); ENDDOCUMENT(); ``` Attempting to open the problem with the develop or main branch will consume all of your server's resources, and eventually the oomkiller will kill the process. The changes in this pull request were suggested by @dpvc in an email communication between @Alex-Jordan, @dpvc, and myself.
1 parent 9dbb09a commit fdf168f

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

macros/contexts/contextFraction.pl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,15 @@ sub _check {
646646
# operator we didn't otherwise subclass.
647647
#
648648
package context::Fraction::BOP::Space;
649-
our @ISA = ('context::Fraction::BOP::space');
649+
our @ISA = ('context::Fraction::Class', 'Parser::BOP');
650+
651+
sub _check {
652+
my $self = shift;
653+
my $context = $self->context;
654+
$self->{bop} = $self->{def}{string};
655+
$self->{def} = $context->{operators}{ $self->{bop} };
656+
return $self->mutate->_check;
657+
}
650658

651659
#################################################################################################
652660
#################################################################################################

0 commit comments

Comments
 (0)