Skip to content

Commit

Permalink
Fixed SegFault (#137)
Browse files Browse the repository at this point in the history
* Fixed SegFault (#129)
* Updated Rice gem to 4.1
* Set minimal MacOS version 10.15 in order to meet Rice 4.1 requirements
  • Loading branch information
maxirmx authored Dec 12, 2023
1 parent 546c5d4 commit a022000
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ jobs:
id: cache
with:
path: lib/expressir/express/express_parser.*
key: v4-${{ runner.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}
key: v4-${{ matrix.os }}-${{ matrix.ruby }}-${{ hashFiles('ext/express-parser/extconf.rb', 'ext/express-parser/antlrgen/**', 'ext/express-parser/express_parser.cpp', '.git/modules/ext/express-parser/antlr4-upstream/HEAD') }}

- name: Build native extension
if: steps.cache.outputs.cache-hit != 'true'
Expand Down
2 changes: 1 addition & 1 deletion expressir.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Gem::Specification.new do |spec|

spec.extensions = File.join(*%w(ext express-parser extconf.rb))

spec.add_runtime_dependency "rice", "~> 4.0.3"
spec.add_runtime_dependency "rice", "~> 4.1"
spec.add_runtime_dependency "thor", "~> 1.0"
spec.add_development_dependency "antlr4-native", "~> 2.1.0"
spec.add_development_dependency "asciidoctor", "~> 2.0.13"
Expand Down
4 changes: 2 additions & 2 deletions ext/express-parser/express_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18136,7 +18136,7 @@ Object ContextProxy::wrapParseTree(tree::ParseTree* node) {

class ParserProxyExt : public Object {
public:
ParserProxyExt(Object self, string file) {
ParserProxyExt(string file) {
ifstream stream;
stream.open(file);
input = new ANTLRInputStream(stream);
Expand Down Expand Up @@ -18427,7 +18427,7 @@ void Init_express_parser() {
.define_method("token_index", &TokenProxy::getTokenIndex);

rb_cParserExt = define_class_under<ParserProxyExt>(rb_mExpressParser, "ParserExt")
.define_constructor(Constructor<ParserProxyExt, Object, string>())
.define_constructor(Constructor<ParserProxyExt, string>())
.define_method("syntax", &ParserProxyExt::syntax, Return().keepAlive())
.define_method("tokens", &ParserProxyExt::getTokens)
.define_method("visit", &ParserProxyExt::visit, Return().keepAlive());
Expand Down
4 changes: 2 additions & 2 deletions ext/express-parser/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@
# workaround for LoadError: 127: The specified procedure could not be found.
$DLDFLAGS << " -static-libgcc -static-libstdc++"
when /darwin/
$CXXFLAGS << " -mmacosx-version-min=10.14 -fno-c++-static-destructors"
$DLDFLAGS << " -mmacosx-version-min=10.14"
$CXXFLAGS << " -mmacosx-version-min=10.15 -fno-c++-static-destructors"
$DLDFLAGS << " -mmacosx-version-min=10.15"
end
else
require "mkmf-rice"
Expand Down
2 changes: 1 addition & 1 deletion lib/expressir/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Expressir
VERSION = "1.2.10".freeze
VERSION = "1.2.11".freeze
end
4 changes: 2 additions & 2 deletions rakelib/antlr4-native.rake
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def create_pp_class_definition(parser_source_lines)
class ParserProxyExt : public Object {
public:
ParserProxyExt(Object self, string file) {
ParserProxyExt(string file) {
ifstream stream;
stream.open(file);
input = new ANTLRInputStream(stream);
Expand Down Expand Up @@ -115,7 +115,7 @@ def create_class_api(parser_source_lines)
.define_method("token_index", &TokenProxy::getTokenIndex);
rb_cParserExt = define_class_under<ParserProxyExt>(rb_mExpressParser, "ParserExt")
.define_constructor(Constructor<ParserProxyExt, Object, string>())
.define_constructor(Constructor<ParserProxyExt, string>())
.define_method("syntax", &ParserProxyExt::syntax, Return().keepAlive())
.define_method("tokens", &ParserProxyExt::getTokens)
.define_method("visit", &ParserProxyExt::visit, Return().keepAlive());
Expand Down

0 comments on commit a022000

Please sign in to comment.