Skip to content

Commit

Permalink
Showing 4 changed files with 15 additions and 10 deletions.
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/marshal/load_tags.txt
Original file line number Diff line number Diff line change
@@ -2,9 +2,6 @@ fails:Marshal.load loads an array containing objects having _dump method, and wi
fails:Marshal.load loads an array containing objects having marshal_dump method, and with proc
fails:Marshal.load loads a Random
fails:Marshal.load for an Array loads an array containing the same objects
fails:Marshal.load for an Exception loads a marshalled exception with no message
fails:Marshal.load for an Exception loads a marshalled exception with a message
fails:Marshal.load for an Exception loads a marshalled exception with a backtrace
fails:Marshal.load for a user Class raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class
fails:Marshal.load for a user Class that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type
fails:Marshal.load for a wrapped C pointer loads
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/marshal/restore_tags.txt
Original file line number Diff line number Diff line change
@@ -5,9 +5,6 @@ fails:Marshal.restore loads an array containing objects having marshal_dump meth
fails:Marshal.restore loads an Array with proc
fails:Marshal.restore loads a Random
fails:Marshal.restore for an Array loads an array containing the same objects
fails:Marshal.restore for an Exception loads a marshalled exception with no message
fails:Marshal.restore for an Exception loads a marshalled exception with a message
fails:Marshal.restore for an Exception loads a marshalled exception with a backtrace
fails:Marshal.restore for a user Class raises ArgumentError if the object from an 'o' stream is not dumpable as 'o' type user class
fails:Marshal.restore for a user Class that extends a core type other than Object or BasicObject raises ArgumentError if the resulting class does not extend the same type
fails:Marshal.restore for a wrapped C pointer loads
Original file line number Diff line number Diff line change
@@ -136,6 +136,17 @@ public Object message(DynamicObject exception) {

}

@Primitive(name = "exception_set_message")
public abstract static class MessageSetNode extends PrimitiveArrayArgumentsNode {

@Specialization
public Object setMessage(DynamicObject error, Object message) {
Layouts.EXCEPTION.setMessage(error, message);
return error;
}

}

@Primitive(name = "exception_errno_error", needsSelf = false)
public static abstract class ExceptionErrnoErrorPrimitiveNode extends PrimitiveArrayArgumentsNode {

8 changes: 4 additions & 4 deletions truffle/src/main/ruby/core/marshal.rb
Original file line number Diff line number Diff line change
@@ -1151,10 +1151,10 @@ def set_exception_variables(obj)
ivar = get_symbol
value = construct
case ivar
when :bt
obj.__instance_variable_set__ :@custom_backtrace, value
when :mesg
obj.__instance_variable_set__ :@reason_message, value
when :bt
obj.__instance_variable_set__ :@custom_backtrace, value
when :mesg
Truffle.invoke_primitive :exception_set_message, obj, value

This comment has been minimized.

Copy link
@eregon

eregon Aug 3, 2016

Member

Is the indentation change intended?
I prefer case/when/end all on the same column.

This comment has been minimized.

Copy link
@bjfish

bjfish Aug 3, 2016

Contributor

@eregon Fixed at 8350aa6 , Thanks

end
end
end

0 comments on commit 3029df7

Please sign in to comment.