Skip to content

Commit

Permalink
try/with for Expr.TryGetReflectedDefinition (seems to raise exception…
Browse files Browse the repository at this point in the history
…s in some cases)
  • Loading branch information
krauthaufen committed Oct 8, 2022
1 parent f4504f9 commit 4bdd37b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
3 changes: 3 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### 5.2.10
* try/with for Expr.TryGetReflectedDefinition (seems to raise exceptions in some cases)

### 5.2.9
* Fixed issue with topological sort and raytracing data
* Removed warnings in raytracing shaders
Expand Down
4 changes: 3 additions & 1 deletion src/Libs/FShade.Core/Serializer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -823,7 +823,9 @@ module Serializer =
let (|ReflectedCall|_|) (e : Expr) =
match e with
| Call(t,mi,args) ->
let isInline = mi.GetCustomAttributes<InlineAttribute>() |> Seq.isEmpty |> not
let isInline =
try mi.GetCustomAttributes<InlineAttribute>() |> Seq.isEmpty |> not
with _ -> false
match ExprWorkardound.TryGetReflectedDefinition mi with
| Some def ->
let args =
Expand Down
3 changes: 2 additions & 1 deletion src/Libs/FShade.Imperative/Utilities.fs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ module ExprWorkardound =

let TryGetReflectedDefinition (mb : MethodBase) =
lock lockObj (fun _ ->
Expr.TryGetReflectedDefinition mb
try Expr.TryGetReflectedDefinition mb
with _ -> None
)

module Peano =
Expand Down

0 comments on commit 4bdd37b

Please sign in to comment.