summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorNathan Ladd <[email protected]>2021-07-09 08:10:48 -0500
committerNathan Ladd <[email protected]>2021-07-09 08:16:12 -0500
commit6598607fead9ba7be0bea10bb42faaab6d9c2f4a (patch)
tree9125a733e8f4253c89018a3b6a8d0d26236efd28 /lib
parent93cce94e0601cb10548e85e59e87f529ebdeb617 (diff)
downloadmruby-6598607fead9ba7be0bea10bb42faaab6d9c2f4a.tar.gz
mruby-6598607fead9ba7be0bea10bb42faaab6d9c2f4a.zip
Mrbgem gem_init.c compilation correction
When `disable_cdump` is declared on a Mrbgem spec, the procedure for loading MRuby code from the gem's `mrblib` directory is slightly different; instead of loading the mrblib code as a Proc built from the compiled irep, the compiled irep is loaded directly. The header files `mruby.h` and `mruby/proc.h` are needed only when the irep is loaded directly. They are currently included only when presym is disabled, they should be included whenever either presym is disabled *or* when `disable_cdump` is called. The `cdump?` predicate method happens to return true in either case (presym disabled *or* cdump disabled), so this change should be safe.
Diffstat (limited to 'lib')
-rw-r--r--lib/mruby/gem.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/mruby/gem.rb b/lib/mruby/gem.rb
index 716f21286..fa0bb3a49 100644
--- a/lib/mruby/gem.rb
+++ b/lib/mruby/gem.rb
@@ -253,7 +253,7 @@ module MRuby
f.puts %Q[#include <mruby.h>]
else
f.puts %Q[#include <stdlib.h>]
- unless build.presym_enabled?
+ unless cdump?
f.puts %Q[#include <mruby.h>]
f.puts %Q[#include <mruby/proc.h>]
end